NAV
curl

API Introduction

This is our API Endpoint (When we go live, that is!)

https://api.skveege.com

Welcome to the Skveege API documentation. This is the API used by the official Skveege web interface as well as our Mobile App, so everything the web ui is able to do can also be accomplished via the API.

The Skveege API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients, and we support cross-origin resource sharing to allow you to interact securely with our API from a client-side web application (though you should remember that you should never expose your secret API key in any public website’s client-side code). JSON will be returned in all GET, PUT and POST responses from the API, including errors. Only exception is DELETE requests which returns an empty response upon success.

Feedback

We would love your feedback at any time. Contact us through Facebook or Google+.

Authentication

Example Request

$ curl https://api.skveege.com/account \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

curl uses the X-Auth-Token header to pass an auth token. A sample test API key has been provided in all the examples on the page, so you can test out any example right away.

You authenticate to the Skveege API by providing one of your API keys in the request. You can manage your API keys from your account. You can have multiple API keys active at one time. Your API keys carry many privileges, so be sure to keep them secret!

Authentication to the API occurs via a Token given in the HTTP headers. Provide your API key as value of the X-Auth-Token header.

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. You must authenticate for all requests.

HTTP Status Codes

Skveege uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing etc.), and codes in the 5xx range indicate an error with Skveege’s servers.

HTTP Status Code Summary

HTTP Code Meaning
200 - OK Everything worked as expected.
400 - Bad Request Often missing a required parameter.
401 - Unauthorized No valid API key provided.
402 - Request Failed Parameters were valid but request failed.
403 - Forbidden Action not allowed for provided API key.
404 - Not Found The requested item doesn’t exist.
429 - Too many requests Request limit exceeded. 
500, 502, 503, 504 - Server Errors Something went wrong on Skveege’s end.

Errors

Example Response

{
    "type": "invalid_request",
    "message": "'name' must be specified.",
    "param": "name"
}

When an error occurs the response will always contain a JSON object as shown to the right. The following is the explanation of the Error object.

Attributes

Field Optional Explained
type No The type of error returned. Can be invalid_request_error or api_error
message Yes A human-readable message giving more details about the error.
param Yes The parameter the error relates to if the error is parameter-specific. You can use this to display a message near the correct form field, for example.

Types

Value Explained
invalid_request_error Invalid request errors arise when your request has invalid parameters.
api_error API errors cover any other type of problem (e.g. a temporary problem with Skveege’s servers) and should turn up only very infrequently.

Request Limit

The Skveege API will rate limit requests on a per-API key basis. Each key will by default have a limit of 30 requests per minute. If you exceed your rate limit you will receive an API response with a 429 HTTP status code and a brief message indicating you have exceeded your rate limit.

To increase your rate limit, contact sales.

Pagination

All top-level Skveege API resources have support for bulk fetches — “list” API methods. For instance you can list orders, list payments, and list agreements. These list API methods share a common structure. Skveege utilizes cursor-based pagination, using the parameter page. Pass page to dictate where in the list you would like to begin (see below).

Arguments

Field Optional Explained
size Yes Size of page. Defines the number of objects to be returned. Size can range between 1 and 100 items. Default limit is 20.
page Yes A zero-based cursor for use in pagination. Page is a number that defines your place in the list. For instance, if you make a list request and receive 100 objects, your subsequent call can set page=1 in order to fetch the next page of the list.

Expanding objects

Many objects contain the id of another object in their response properties. Some of these objects can be expanded inline with the expand request parameter. Objects that can be expanded are noted in this documentation.

This parameter is available on all API requests, and applies to the response of that request only. You can nest expand requests with the dot property. You can expand multiple things at once by sending an array.

Metadata

Most updatable Skveege objects support a user-specified metadata parameter.

You can use the metadata parameter to attach key-value data. This is useful for storing additional structured information about an object. As an example, you could store your user’s full name, favorite color, and their corresponding unique identifier from your system on a Skveege customer object.

Note: You can have up to 20 keys, with key names up to 40 characters long and values up to 500 characters long.

Account

This is an object representing your Skveege account. You can retrieve it to see properties on the account like its current e-mail address etc. You are allowed to change parameters for your own account only.

The account object also holds information about the user’s authorizations in the property ‘roles’. There are 2 kinds of roles: (1) system-wide roles and (2) organization-specific roles. System-wide roles are prefixed with ROLE_ and organization-specific roles are prefixed with ORGROLE_ followed by the id of the specific organization.

The account object

Example Response

{
    "id": "acct_7B10MYfEnPp6r",
    "login": "john",
    "name": "John Dow",
    "email": "john@doe.com",
    "emailValidated": true,
    "languageCode": "da",
    "roles": [
        "ROLE_USER",
        "ORGROLE_org-ZW46jOjfA0rpDZ_USER"
    ],
    "meta": {
        "hairColor": "Brown"
    }
}
Field Type Required Description
login string Yes -
name string Yes Full name of user
email string Yes -
emailValidated boolean No -
languageCode string No 2-letter ISO 639-1 code, fx. 'da’
roles array No Array of user’s system and organization roles.
meta object No Dictionary of meta values.

Retrieve an account

Definition

GET https://api.skveege.com/account

Example Request

curl https://api.skveege.com/account \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "id": "acct_7B10MYfEnPp6r",
    "login": "john",
    "name": "John Dow",
    "email": "john@doe.com",
    "emailValidated": true,
    "languageCode": "da",
    "roles": ["ROLE_USER"],
    "meta": {
        "hairColor": "Brown"
    }
}

Retrieves the details of the account.

Arguments

Field Type Required Description
id string Yes The identifier of the account to be retrieved.

Returns

Returns an account object if a valid identifier was provided.

Update an account

Definition

POST https://api.skveege.com/account

Example Request

curl https://api.skveege.com/account \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d email=jane@doe.com

Example Response

{
    "id": "acct_7B10MYfEnPp6r",
    "login": "john",
    "name": "John Dow",
    "email": "jane@doe.com",
    "emailValidated": false,
    "languageCode": "da",
    "roles": ["ROLE_USER"],
    "meta": {
        "hairColor": "Brown"
    }
}

Updates an account by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Arguments

Field Type Required Description
name string Yes Full name of user
email string No -
languageCode string No 2-letter ISO 639-1 code, fx. 'da’
meta object No Dictionary of meta values.

Returns

Returns the account object if the update succeeded. Returns an error if update parameters are invalid.

Delete an account

Definition

DELETE https://api.skveege.com/account

Example Request

curl https://api.skveege.com/account \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -X DELETE

Permanently deletes an account. It cannot be undone.

Arguments

Field Type Required Description
id string Yes The identifier of the account to be deletes.

Returns

Returns an empty response upon success. If the account ID does not exist, this call returns an error.

Organization

This is an object representing an organization in Skveege. You can retrieve it to see properties on the organization like its current e-mail address, physical address etc.

You are only allowed to access the organization your account refers to.

The organization object

Example Response

{
    "id": "acct_123123123",
    "name": "Vinduespudser A/S",
    "url": "http://vinduespudser.nu",
    "address": "Pudservej 111",
    "postalCode": "1234",
    "city": "Pudserby",
    "countryCode": "DK",
    "phone": "+452209876543",
    "email": "vindue@pudser.dk",
    "registrationNo": "12345678",
    "terminated": false,
    "terminationTime": null,
    "createdDate": "2015-01-01T00:00:00Z",
    "trial": true,
    "subscriptionPrice": 0,
    "subscriptionPeriod": "Monthly",
    "subscriptionDiscount": 0.0,
    "subscriptionExpires": null,
    "subscriptionType": "Free",
    "languageCode": "da",
    "baseCurrency": "DKK",
    "locked": false,
    "subjectToVat": true,
    "timeZone": "Europe/Copenhagen"
}
Field Type Required Description
id string No -
name string Yes Name of the business, fx. ‘Vinduespudser A/S’
url string No -
address string No The street address, 'fx. Vesterbro 11’
postalCode string No -
city string No -
countryCode string No 2-letter ISO 3166-1 code, fx. 'DK’
phone string No Full international phonenumber, fx. ’+4522123456’
email string No -
registrationNo string No The business’s EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
terminated boolean No -
terminationTime datetime No -
createdDate datetime No -
trial boolean No -
subscriptionPrice number No Price for subscription in 1⁄100 of the monetary unit (fx. cents or øre)
subscriptionPeriod string No 'Monthly’, 'Quarterly’, 'SemiAnnually’ or 'Annually’. Default is 'Monthly’.
subscriptionDiscount number No -
subscriptionExpires datetime No -
subscriptionType string No 'Free’, 'Micro’, 'Small’, 'Medium’ or 'Large’.
languageCode string No 2-letter ISO 639-1 code, fx. 'da’
baseCurrency string Yes 3-letter ISO 4217 code, fx. 'DKK’
locked boolean No -
subjectToVat boolean No -
timeZone string No -
referenceId string No An optional id for other systems to use for refering to this organization.

Create an organization

Definition

POST https://api.skveege.com/organizations

Example Request

curl https://api.skveege.com/organizations \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d name="Vinduespudser A/S"

Example Response

{
    "id": "acct_123123123",
    "name": "Vinduespudser A/S",
    "url": null,
    "address": null,
    "postalCode": null,
    "city": null,
    "countryCode": "DK",
    "phone": null,
    "email": null,
    "registrationNo": null,
    "terminated": false,
    "terminationTime": null,
    "createdDate": "2015-01-01T00:00:00Z",
    "trial": true,
    "subscriptionPrice": 0,
    "subscriptionPeriod": "Monthly",
    "subscriptionDiscount": 0.0,
    "subscriptionExpires": null,
    "subscriptionType": "Free",
    "languageCode": "da",
    "baseCurrency": "DKK",
    "locked": false,
    "subjectToVat": true,
    "timeZone": "Europe/Copenhagen"
}

Creates a new organization.

A user can only create a new organization if it is not related to an organization yet. When a user creates a new organization it will automatically become related to the created organization.

Arguments

Field Type Required Description
name string Yes Name of the business, fx. 'Vinduespudser A/S’
url string No -
address string No The street address, 'fx. Vesterbro 11’
postalCode string No -
city string No -
countryCode string No 2-letter ISO 3166-1 code, fx. 'DK’
phone string No Full international phonenumber, fx. ’+4522123456’
email string No -
registrationNo string No The business’s EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
languageCode string No 2-letter ISO 639-1 code, fx. 'da’
baseCurrency string No 3-letter ISO 4217 code, fx. 'DKK’
subjectToVat boolean No -
timeZone string No -

Returns

Returns an organization object if the call succeeded. If a invalid parameters are provided, the call will return an error.

Retrieve an organization

Definition

GET https://api.skveege.com/organization

Example Request

curl https://api.skveege.com/organization \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "id": "acct_123123123",
    "name": "Vinduespudser A/S",
    "url": "http://vinduespudser.nu",
    "address": "Pudservej 111",
    "postalCode": "1234",
    "city": "Pudserby",
    "countryCode": "DK",
    "phone": "+452212341234",
    "email": "vindue@pudser.dk",
    "registrationNo": "12345678",
    "terminated": false,
    "terminationTime": null,
    "createdDate": "2015-01-01T00:00:00Z",
    "trial": true,
    "subscriptionPrice": 0,
    "subscriptionPeriod": "Monthly",
    "subscriptionDiscount": 0.0,
    "subscriptionExpires": null,
    "subscriptionType": "Free",
    "languageCode": "da",
    "baseCurrency": "DKK",
    "locked": false,
    "subjectToVat": true,
    "timeZone": "Europe/Copenhagen"
}

Retrieves the details of the organization.

Arguments

Field Type Required Description
id string Yes The identifier of the organization to be retrieved.

Returns

Returns an organization object if a valid identifier was provided.

Update an organization

Definition

POST https://api.skveege.com/organizations/{organization_ID}

Example Request

curl https://api.skveege.com/organizations/acct_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d phone=+452209876543

Example Response

{
    "id": "acct_123123123",
    "name": "Vinduespudser A/S",
    "url": "http://vinduespudser.nu",
    "address": "Pudservej 111",
    "postalCode": "1234",
    "city": "Pudserby",
    "countryCode": "DK",
    "phone": "+452209876543",
    "email": "vindue@pudser.dk",
    "registrationNo": "12345678",
    "terminated": false,
    "terminationTime": null,
    "createdDate": "2015-01-01T00:00:00Z",
    "trial": true,
    "subscriptionPrice": 0,
    "subscriptionPeriod": "Monthly",
    "subscriptionDiscount": 0.0,
    "subscriptionExpires": null,
    "subscriptionType": "Free",
    "languageCode": "da",
    "baseCurrency": "DKK",
    "locked": false,
    "subjectToVat": true,
    "timeZone": "Europe/Copenhagen"
}

Updates an organization by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Arguments

Field Type Required Description
name string Yes Name of the business, fx. 'Vinduespudser A/S’
url string No -
address string No The street address, 'fx. Vesterbro 11’
postalCode string No -
city string No -
countryCode string No 2-letter ISO 3166-1 code, fx. 'DK’
phone string No Full international phonenumber, fx. ’+4522123456’
email string No -
registrationNo string No The business’s EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
languageCode string No 2-letter ISO 639-1 code, fx. 'da’
baseCurrency string No 3-letter ISO 4217 code, fx. 'DKK’
subjectToVat boolean No -
timeZone string No -

Returns

Returns the organization object if the update succeeded. Returns an error if update parameters are invalid.

Delete an organization

Definition

DELETE https://api.skveege.com/organizations/{organization_ID}

Example Request

curl https://api.skveege.com/organizations/acct_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -X DELETE

Permanently deletes an organization. It cannot be undone.

Arguments

Field Type Required Description
id string Yes The identifier of the organization to be deletes.

Returns

Returns an empty response upon success. If the organization ID does not exist, this call returns an error.

Contact

A Contact specifies a Customer’s information. The Contact can be a private person or a Company.

The contact object

Example Response

{
    "id": "con_123123123",
    "name": "Anna Jensen",
    "address": "Kundevej 2",
    "postalCode": "4321",
    "city": "Kundeby",
    "countryCode": "DK",
    "number": null,
    "phone": "+452209876543",
    "email": "anna@jensen.dk",
    "registrationNo": null,
    "ean": null,
    "paymentTermsDays": null,
    "archived": false,
    "meta": {
        "hairColor": "Brown"
    }
}
Field Type Required Description
id string No -
name string Yes The name of the contact. Can be either a company name or a person’s name.
address string No The street address, ‘fx. Vesterbro 11’
postalCode string No -
city string No -
countryCode string No 2-letter ISO 3166-1 code, fx. 'DK’
number string No Arbitrary number (or string) that contacts can be referred to by.
phone string No Full international phonenumber, fx. ’+4522123456’
email string No -
registrationNo string No The contact’s EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
ean string No The contact’s EAN (European Article Number).
paymentTermsDays integer No -
archived boolean No -
meta object No Dictionary of meta value.

Create a contacts

Definition

POST https://api.skveege.com/contacts

Example Request

curl https://api.skveege.com/contacts \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d name="Anna Jensen" \
   -d meta[hairColor]=Brown

Example Response

{
    "id": "con_123123123",
    "name": "Anna Jensen",
    "address": "Kundevej 2",
    "postalCode": "4321",
    "city": "Kundeby",
    "countryCode": "DK",
    "number": null,
    "phone": "+452209876543",
    "email": "anna@jensen.dk",
    "registrationNo": null,
    "ean": null,
    "paymentTermsDays": null,
    "archived": false,
    "meta": {
        "hairColor": "Brown"
    }
}

Creates a new contact.

Arguments

Field Type Required Description
name string Yes The name of the contact. Can be either a company name or a person’s name.
address string No The street address, 'fx. Vesterbro 11’
postalCode string No -
city string No -
countryCode string No 2-letter ISO 3166-1 code, fx. 'DK’
number integer No Arbitrary number (or string) that contacts can be referred to by.
phone string No Full international phonenumber, fx. ’+4522123456’
email string No -
registrationNo string No The contact’s EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
ean string No The contact’s EAN (European Article Number).
paymentTermsDays integer No -
meta object No Dictionary of meta value.

Returns

Returns an contact object if the call succeeded.

Retrieve a contact

Definition

GET https://api.skveege.com/contacts/{CONTACT_ID}

Example Request

curl https://api.skveege.com/contacts/con_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "id": "con_123123123",
    "name": "Anna Jensen",
    "address": "Kundevej 2",
    "postalCode": "4321",
    "city": "Kundeby",
    "countryCode": "DK",
    "number": null,
    "phone": "+452209876543",
    "email": "anna@jensen.dk",
    "registrationNo": null,
    "ean": null,
    "paymentTermsDays": null,
    "archived": false,
    "meta": {
        "hairColor": "Brown"
    }
}

Retrieves the details of an existing contact. You need only supply the unique contact identifier that was returned with the contact object upon a successfull creation.

Arguments

Field Type Required Description
id string Yes The identifier of the contact to be retrieved.

Returns

Returns a contact object if a valid identifier was provided.

Update a contact

Definition

POST https://api.skveege.com/contacts/{CONTACT_ID}

Example Request

curl https://api.skveege.com/contacts/cot_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d phone=+4522123456

Example Response

{
    "id": "con_123123123",
    "name": "Anna Jensen",
    "address": "Kundevej 2",
    "postalCode": "4321",
    "city": "Kundeby",
    "countryCode": "DK",
    "number": null,
    "phone": "+4522123456",
    "email": "anna@jensen.dk",
    "registrationNo": null,
    "ean": null,
    "paymentTermsDays": null,
    "archived": false,
    "meta": {
        "hairColor": "Brown"
    }
}

Updates the specified contact by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the address parameter, that becomes the contact’s new address.

This request accepts mostly the same arguments as the contact creation call.

Arguments

Field Type Required Description
name string Yes The name of the contact. Can be either a company name or a person’s name.
address string No The street address, 'fx. Vesterbro 11’
postalCode string No -
city string No -
countryCode string No 2-letter ISO 3166-1 code, fx. 'DK’
number integer No Arbitrary number (or string) that contacts can be referred to by.
phone string No Full international phonenumber, fx. ’+4522123456’
email string No -
registrationNo string No The contact’s EU VAT number, CVR number in Denmark, TIN/EIN/SSN in US.
ean string No The contact’s EAN (European Article Number).
paymentTermsDays integer No -
meta object No Dictionary of meta value.

Returns

Returns the contact object if the update succeeded. Returns an error if update parameters are invalid.

Delete a contact

Definition

DELETE https://api.skveege.com/contacts/{CONTACT_ID}

Example Request

curl https://api.skveege.com/contacts/con_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -X DELETE

Permanently deletes a contact. It cannot be undone.

Arguments

Field Type Required Description
id string Yes The identifier of the contact to be deleted.

Returns

Returns an empty response upon success. If the contact ID does not exist, this call returns an error.

List all contacts

Definition

GET https://api.skveege.com/contacts

Example Request

curl https://api.skveege.com/contacts \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

[
    {
        "id": "con_123123123",
        "name": "Anna Jensen",
        "address": "Kundevej 2",
        "postalCode": "4321",
        "city": "Kundeby",
        "countryCode": "DK",
        "number": null,
        "phone": "+4522123456",
        "email": "anna@jensen.dk",
        "registrationNo": null,
        "ean": null,
        "paymentTermsDays": null,
        "archived": false,
        "meta": {
            "hairColor": "Brown"
        }
    },
    {  },
    {  },
    "... And then as many results as available or requested"

]

Returns a list of your contacts.

Arguments

Field Optional Explained
size Yes A limit on the number of objects to be returned. Size can range between 1 and 100 items. Default size is 20.
page Yes A zero-based cursor for use in pagination. Page is a number that defines your place in the list. For instance, if you make a list request and receive 100 objects, your subsequent call can set page=1 in order to fetch the next page of the list.
search Yes A free text search field. Cannot be used in combination with nearby.
nearby Yes Sorts the result by the distance to a given coordinate, fx. ’?nearby=-7.437336444854736,62.11042750510291’. Cannot be used in combination with search.

Returns

An array of up to limit contacts, starting after offset. Each entry in the array is a separate contact object. If no more contacts are available, the resulting array will be empty. This request should never return an error.

Order

Orders are statements of what a customer has ordered. It can optionally be invoiced if the customer is identified. Once an order is created and approved, Payment for it can be created as well.

An order of type ‘Credit’ can credit an existing order ONLY if that order has been invoiced. When is does that it will work as a balance modifier towards the order being credited. Otherwise the credit order will have a negative balance and must be balance modified via a Debit Payment.

The order object

Example Response

{
    "id": "ord_123123123",
    "type": "Sale",
    "number": "1344",
    "contactId": null,
    "contactName": null,
    "contactAddress": null,
    "contactCountryCode": null,
    "notes": null,
    "date": "2015-01-01",
    "dueDate": "2015-01-09",
    "creditOrderId": null,
    "state": "draft",
    "currency": "DKK",
    "balance": 0,
    "paid": false,
    "orderHolderId": null,
    "paymentTermsDays": 14,
    "lines": [
        {
            "description": "Window Cleaning",
            "quantity": 1.0,
            "unitPrice": 12300,
            "taxRate": 25.0
        }
    ]
}
Field Type Required Description
id string No -
type string No Whether to create an 'Sale’ or a 'Credit’ order. Defaults to 'Sale’.
number string No Must be unique. If not set when the order gets approved, it will automatically be assigned a number.
contactId string No -
contactName string No -
contactAddress string No -
contactCountryCode string No -
notes string No -
date string No The order date. This parameter must not be set if the order has already been approved. Defaults to current date.
dueDate string No The due date for payment of the order.
paymentTermsDays integer No -
creditOrderId string No -
state string No 'draft’ or 'approved’. When approved, no more changes can be made to the order.
currency string No Currency of the order. Default to the organization’s baseCurrency.
balance number No Balance specified in øre.
paid boolean No -
orderHolderId string No Id of an order holder to connect this order to.
paymentTermsDays number No Number of days into the future the due date should be when order is accepted.
lines array No Lines for the order. At minimum one line must be supplied when changing from draft to approved.

The order line object

Field Type Required Description
description string No -
quantity number No -
unitPrice number No Price for subscription in 1⁄100 of the monetary unit (fx. cents or øre)
taxRate number No -

Create an order

Definition

POST https://api.skveege.com/orders

Example Request

curl https://api.skveege.com/orders \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d number="1344" \
   -d paymentTermsDays=10

Example Response

{
    "id": "ord_123123123",
    "type": "Sale",
    "number": "1344",
    "contactId": null,
    "contactName": null,
    "contactAddress": null,
    "contactCountryCode": null,
    "notes": null,
    "date": "2015-01-01",
    "dueDate": "2015-01-09",
    "creditOrderId": null,
    "state": "draft",
    "currency": "DKK",
    "balance": 0,
    "paid": false,
    "orderHolderId": null,
    "paymentTermsDays": 14,
    "lines": [ ]
}

Creates a new order.

Arguments

Field Type Required Description
type string No Whether to create an 'Sale’ or a 'Credit’ order. Defaults to 'Sale’.
number string No Must be unique. If not set it will automatically be assigned a number.
contactId string No -
contactName string No -
contactAddress string No -
contactCountryCode string No -
notes string No -
date string No The order date. This parameter must not be set if the order has already been approved. Defaults to current date.
creditOrderId string No -
currency string No Currency of the order. Default to the organization’s baseCurrency.
orderHolderId string No Id of an order holder to connect this order to.
paymentTermsDays number No Number of days into the future the due date should be when order is accepted.
lines array No Lines for the order. At minimum one line must be supplied.

Returns

Returns an order object if the call succeeded. If invalid arguments are provided, the call will return an error.

Retrieve an order

Definition

GET https://api.skveege.com/orders/{order_ID}

Example Request

curl https://api.skveege.com/orders/ord_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "id": "ord_123123123",
    "type": "Sale",
    "number": "1344",
    "contactId": null,
    "contactName": null,
    "contactAddress": null,
    "contactCountryCode": null,
    "notes": null,
    "date": "2015-01-01",
    "dueDate": "2015-01-09",
    "creditOrderId": null,
    "state": "draft",
    "currency": "DKK",
    "balance": 0,
    "paid": false,
    "orderHolderId": null,
    "paymentTermsDays": 14,
    "lines": [ ]
}

Retrieves the details of an existing order. You need only supply the unique order identifier that was returned with the order object upon a successfull creation.

Arguments

Field Type Required Description
id string Yes The identifier of the order to be retrieved.

Returns

Returns an order object if a valid identifier was provided.

Update an order

Definition

POST https://api.skveege.com/orders/{order_ID}

Example Request

curl https://api.skveege.com/orders/_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d number=1345

Example Response

{
    "id": "ord_123123123",
    "type": "Sale",
    "number": "1345",
    "contactId": null,
    "contactName": null,
    "contactAddress": null,
    "contactCountryCode": null,
    "notes": null,
    "date": "2015-01-01",
    "dueDate": "2015-01-09",
    "creditOrderId": null,
    "state": "draft",
    "currency": "DKK",
    "balance": 0,
    "paid": false,
    "orderHolderId": null,
    "paymentTermsDays": 14,
    "lines": [ ]
}

Updates the specified order by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the number parameter, that becomes the order’s new order number.

This request accepts mostly the same arguments as the order creation call.

Arguments

Field Type Required Description
number string No Must be unique. If not set it will automatically be assigned a number.
contactId string No -
contactName string No -
contactAddress string No -
contactCountryCode string No -
notes string No -
date string No The order date. This parameter must not be set if the order has already been approved. Defaults to current date.
creditOrderId string No -
currency string No Currency of the order. Default to the organization’s baseCurrency.
orderHolderId string No Id of an order holder to connect this order to.
paymentTermsDays number No Number of days into the future the due date should be when order is accepted.
lines array No Lines for the order. At minimum one line must be supplied.

Returns

Returns the order object if the update succeeded. Returns an error if update parameters are invalid.

Delete an order

Definition

DELETE https://api.skveege.com/orders/{order_ID}

Example Request

curl https://api.skveege.com/orders/ord_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -X DELETE

Permanently deletes an order. It cannot be undone.

Arguments

Field Type Required Description
id string Yes The identifier of the order to be delete.

Returns

Returns an empty response upon success. If the order ID does not exist, this call returns an error.

List all orders

Definition

GET https://api.skveege.com/orders

Example Request

curl https://api.skveege.com/orders \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

[
    {
        "id": "ord_123123123",
        "type": "Sale",
        "number": "1345",
        "contactId": null,
        "contactName": null,
        "contactAddress": null,
        "contactCountryCode": null,
        "notes": null,
        "date": "2015-01-01",
        "dueDate": "2015-01-09",
        "creditOrderId": null,
        "state": "draft",
        "currency": "DKK",
        "balance": 0,
        "paid": false,
        "orderHolderId": null,
        "paymentTermsDays": 14,
        "lines": [ ]
    },
    {  },
    {  },
    "... And then as many results as available or requested"

]

Returns a list of your orders.

Arguments

Field Optional Explained
size Yes A limit on the number of objects to be returned. Size can range between 1 and 100 items. Default size is 20.
page Yes A zero-based cursor for use in pagination. Page is a number that defines your place in the list. For instance, if you make a list request and receive 100 objects, your subsequent call can set page=1 in order to fetch the next page of the list.

Returns

An array of up to limit orders, starting after offset. Each entry in the array is a separate order object. If no more orders are available, the resulting array will be empty. This request should never return an error.

Approve order

Definition

POST https://api.skveege.com/orders/{order_ID}/approve

Example Request

curl https://api.skveege.com/orders/ord_123123123/approve \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -X POST

Approves an order leaving it unchangeable. After an order has been approved only payments can result in any changes to the order, as it will update its balance.

Split order

Splits an order into two by defining the items to move to a new order. The new order will be identical to this order except for the order lines. After splitting, the total of the 2 orders will equal to the total of the original order.

Binder

An binder specifies an item that orders can be connected to. The purpose is often related to the type of a business. Fx. a window cleaner could create an binder for each area he works in and then connect his orders to these areas. Afterwards he will be able to draw out all orders for each specific areas.

In other circumstances, fx. a restaurant, tables could be defined as binders. Doing that makes it possible to retrieve open orders for a specific table in order for the customers to settle the bill when leaving. Having an binder makes it easy to split an order for the table into seperate orders billable to different customers around the same table.

The binder object

Example Response

{
    "id": "ohlr_123123123",
    "name": "Aalborg",
    "meta": {
        "latitude": "57.048820",
        "longitude": "9.921747"
    }
}
Field Type Required Description
id string No -
name string Yes The name of the binder.
meta object No Dictionary of meta value.

Create an binder

Definition

POST https://api.skveege.com/binders

Example Request

curl https://api.skveege.com/binders \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d name="Aalborg"

Example Response

{
    "id": "ohlr_123123123",
    "name": "Aalborg",
    "meta": {
    }
}

Creates a new binder.

Arguments

Field Type Required Description
name string Yes The name of the binder.
meta object No Dictionary of meta value.

Returns

Returns an binder object if the call succeeded.

Retrieve an binder

Definition

GET https://api.skveege.com/binders/{binder_ID}

Example Request

curl https://api.skveege.com/binders/ohlr_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "id": "ohlr_123123123",
    "name": "Aalborg",
    "meta": {
    }
}

Retrieves the details of an existing binder. You need only supply the unique binder identifier that was returned with the binder object upon a successfull creation.

Arguments

Field Type Required Description
id string Yes The identifier of the binder to be retrieved.

Returns

Returns an binder object if a valid identifier was provided.

Update an binder

Definition

POST https://api.skveege.com/binders/{binder_ID}

Example Request

curl https://api.skveege.com/binders/ohlr_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d name=Aalborg

Example Response

{
    "id": "ohlr_123123123",
    "name": "Aalborg",
    "meta": {
    }
}

Updates the specified binder by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the address parameter, that becomes the binder’s new address.

This request accepts mostly the same arguments as the binder creation call.

Arguments

Field Type Required Description
name string Yes The name of the binder.
meta object No Dictionary of meta value.

Returns

Returns the binder object if the update succeeded. Returns an error if update parameters are invalid .

Delete an binder

Definition

DELETE https://api.skveege.com/binders/{binder_ID}

Example Request

curl https://api.skveege.com/binders/ohlr_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -X DELETE

Permanently deletes an binder. It cannot be undone.

Arguments

Field Type Required Description
id string Yes The identifier of the binder to be deleted.

Returns

Returns an empty response upon success. If the binder ID does not exist, this call returns an error.

List all binders

Definition

GET https://api.skveege.com/binders

Example Request

curl https://api.skveege.com/binders \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

[
    {
        "id": "ohlr_123123123",
        "name": "Aalborg",
        "meta": {
        }
    },
    {  },
    {  },
    "... And then as many results as available or requested"

]

Returns a list of your binders.

Arguments

Field Optional Explained
size Yes A limit on the number of objects to be returned. Size can range between 1 and 100 items. Default size is 20.
page Yes A zero-based cursor for use in pagination. Page is a number that defines your place in the list. For instance, if you make a list request and receive 100 objects, your subsequent call can set page=1 in order to fetch the next page of the list.

Returns

An array of up to limit binders, starting after offset. Each entry in the array is a separate binder object. If no more binders are available, the resulting array will be empty. This request should never return an error.

Payment

A Payment is a registration of money recieved from or withdrawn – optionally connected to a Contact – in order to modify the balance of an Order.

When paying for an order, it is only possible to use the same currency as orderd. Fx. if the currency of the order is DKK, then payments against that order can only be done in DKK as well.

When payments are registered with associations, the API will make sure to update balance and paid accordingly on orders.

The payment object

Example Response

{
    "id": "pay_123123123",
    "contactId": "cot_1132123123",
    "amount": 2399.0,
    "currency": "DKK",
    "type": "bank",
    "createdDate": "2015-01-02T12:00:00Z",
    "transactionDate": "2015-01-01",
    "associations": [
        "ord_123123123"
    ]
}
Field Type Required Description
id string No -
contactId string No Reference to the contact that made the payment.
amount number Yes Ammount in 1⁄100 of the monetary unit (fx. cents or øre)
currency string Yes The currency paid in. Must match the currency the user has been orderd in.
type string Yes The payment type. Either ‘creditcard’, 'bank’ or 'cash’.
createdDate datetime No Time of object created.
transactionDate date Yes The date of transaction.
associations array No Associations of the payment, fx. id of the order(s) it pays for.

Create a payment

Definition

POST https://api.skveege.com/payments

Example Request

curl https://api.skveege.com/payments \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d contactId=cot_1312321312 \
   -d amount=2399.0 \
   -d currency=DKK \
   -d type=bank \
   -d transactionDate=2015-01-01 \
   -d associations[0]=ord_123123123

Example Response

{
    "id": "pay_123123123",
    "contactId": "cot_1132123123",
    "amount": 2399.0,
    "currency": "DKK",
    "type": "bank",
    "createdDate": "2015-01-02T12:00:00Z",
    "transactionDate": "2015-01-01",
    "associations": [
        "ord_123123123"
    ]
}

Creates a new payment.

Arguments

Field Type Required Description
contactId string No Reference to the contact that made the payment.
amount number No The amount paid.
currency string No The currency paid in. Must match the currency the user has been orderd in.
type string Yes The payment type. Either 'creditcard’, 'bank’ or 'cash’.
createdDate datetime No Time of object created.
transactionDate datetime Yes The date of trasaction.
associations array No Associations of the payment, fx. id of the order(s) it pays for.

Returns

Returns a payment object if the call succeeded. If a invalid parameters are provided, the call will return an error.

Retrieve a payment

Definition

GET https://api.skveege.com/payments/{PAYMENT_ID}

Example Request

curl https://api.skveege.com/payments/pay_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "id": "pay_123123123",
    "contactId": "cot_1132123123",
    "amount": 2399.0,
    "currency": "DKK",
    "type": "bank",
    "createdDate": "2015-01-02T12:00:00Z",
    "transactionDate": "2015-01-01",
    "associations": [
        "ord_123123123"
    ]
}

Retrieves the details of an existing payment. You need only supply the unique payment identifier that was returned with the payment object upon a successfull creation.

Arguments

Field Type Required Description
id string Yes The identifier of the payment to be retrieved.

Returns

Returns a payment object if a valid identifier was provided.

List all payments

Definition

GET https://api.skveege.com/payments

Example Request

curl https://api.skveege.com/payments \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

[
    {
        "id": "pay_123123123",
        "contactId": "cot_1132123123",
        "amount": 2399.0,
        "currency": "DKK",
        "type": "bank",
        "createdDate": "2015-01-02T12:00:00Z",
        "transactionDate": "2015-01-01",
        "associations": [
            "ord_123123123"
        ]
    },
    {  },
    {  },
    "... And then as many results as available or requested"

]

Returns a list of your payments.

Arguments

Field Optional Explained
size Yes A limit on the number of objects to be returned. Size can range between 1 and 100 items. Default size is 20.
page Yes A zero-based cursor for use in pagination. Page is a number that defines your place in the list. For instance, if you make a list request and receive 100 objects, your subsequent call can set page=1 in order to fetch the next page of the list.

Returns

An array of up to limit payments, starting after offset. Each entry in the array is a separate payment object. If no more payments are available, the resulting array will be empty. This request should never return an error.

Agreement

An Agreement is when the Organization and a Contact has agreed upon a task to be completed. The Agreement can be for a single task of for a recurring task.

The agreements will automatically be reflected in Events. For an example if an Agreement has been made for a task to be fullfilled each monday then the system will automatically generate events for that task each monday. The events can be changed as needed, but if the Agreement is updated, new events will be generated from that date and forward – overwriting any changes to the events.

The agreement object

Example Response

{
    "id": "agt_123123123",
    "description": "Window Cleaning",
    "amount": 239.0,
    "contactId": "cot_1231231321",
    "recurrenceRule": "FREQ=WEEKLY;INTERVAL=4;WKST=MO",
    "startDate": "2015-01-01",
    "endDate": null,
    "previousDate": null,
    "nextDate": null,
    "archived": false,
    "accountId": null,
    "meta": {
        "Note": "Good Deal"
    }
}
Field Type Required Description
id string No -
description string Yes Short description of the agreement.
amount number No The amount agreed upon in 1⁄100 of the monetary unit (fx. cents or øre)
currency string Yes 3-letter ISO 4217 code, fx. ‘DKK’
contactId string Yes The contact that has entered into agreement with.
recurrenceRule string No The iCal(RFC 2445) RRule specifying optional reccurence.
startDate date Yes The start of the agreement.
endDate date No The end of the agreement.
previousDate date no The previous date work was done, if any.
nextDate date No The next date to accomplish work, if planned.
archived boolean No -
accountId string No Id of the employee that is the caretaker of the agreement.
meta object No Dictionary of meta value.

Create an agreement

Definition

POST https://api.skveege.com/agreements

Example Request

curl https://api.skveege.com/agreements \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d description="Window Cleaning" \
   -d contactId=cot_1231233123 \
   -d startDate=2015-01-01 \
   -d currency=DKK \
   -d meta[note]="Good Deal"

Example Response

{
    "id": "agt_123123123",
    "description": "Window Cleaning",
    "amount": 23900,
    "currency": "DKK",
    "contactId": "cot_1231231321",
    "recurrenceRule": "FREQ=WEEKLY;INTERVAL=4;WKST=MO",
    "startDate": "2015-01-01",
    "endDate": null,
    "previousDate": null,
    "nextDate": null,
    "archived": false,
    "accountId": null,
    "meta": {
        "note": "Good Deal"
    }
}

Creates a new agreement.

Arguments

Field Type Required Description
description string No Short description of the agreement.
amount number No The amount agreed upon.
currency string Yes 3-letter ISO 4217 code, fx. 'DKK’
contactId string Yes The contact that has entered into agreement with.
recurrenceRule string No The iCal(RFC 2445) RRule specifying optional reccurence.
startDate date Yes The start of the agreement.
endDate date No The end of the agreement.
previousDate date no The previous date work was done, if any.
nextDate date No The next date to accomplish work, if planned.
accountId string No Id of the employee that is the caretaker of the agreement.
meta object No Dictionary of meta value.

Returns

Returns an agreement object if the call succeeded. If a invalid parameters are provided, the call will return an error.

Retrieve an agreement

Definition

GET https://api.skveege.com/agreements/{AGREEMENT_ID}

Example Request

curl https://api.skveege.com/agreements/agt_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "id": "agt_123123123",
    "description": "Window Cleaning",
    "amount": 23900,
    "currency": "DKK",
    "contactId": "cot_1231231321",
    "recurrenceRule": "FREQ=WEEKLY;INTERVAL=4;WKST=MO",
    "startDate": "2015-01-01",
    "endDate": null,
    "previousDate": null,
    "nextDate": null,
    "archived": false,
    "accountId": null,
    "meta": {
        "Note": "Good Deal"
    }
}

Retrieves the details of an existing agreement. You need only supply the unique agreement identifier that was returned with the agreement object upon a successfull creation.

Arguments

Field Type Required Description
id string Yes The identifier of the agreement to be retrieved.

Returns

Returns an agreement object if a valid identifier was provided.

Update an agreement

Definition

POST https://api.skveege.com/agreements/{AGREEMENT_ID}

Example Request

curl https://api.skveege.com/agreements/agt_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -d description="Window Cleaning Outside"

Example Response

{
    "id": "agt_123123123",
    "description": "Window Cleaning Outside",
    "amount": 23900,
    "currency": "DKK",
    "contactId": "cot_1231231321",
    "recurrenceRule": "FREQ=WEEKLY;INTERVAL=4;WKST=MO",
    "startDate": "2015-01-01",
    "endDate": null,
    "previousDate": null,
    "nextDate": null,
    "archived": false,
    "accountId": null,
    "meta": {
        "Note": "Good Deal"
    }
}

Updates the specified agreement by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the amount parameter, that becomes the agreements’s new amount.

This request accepts mostly the same arguments as the agreement creation call.

Arguments

Field Type Required Description
description string No Short description of the agreement.
amount number No The amount agreed upon.
currency string Yes 3-letter ISO 4217 code, fx. 'DKK’
contactId string Yes The contact that has entered into agreement with.
recurrenceRule string No The iCal(RFC 2445) RRule specifying optional reccurence.
startDate date No The start of the agreement.
endDate date No The end of the agreement.
previousDate date no The previous date work was done, if any.
nextDate date No The next date to accomplish work, if planned.
accountId string No Id of the employee that is the caretaker of the agreement.
meta object No Dictionary of meta value.

Returns

Returns the agreement object if the update succeeded. Returns an error if update parameters are invalid.

Delete an agreement

Definition

DELETE https://api.skveege.com/agreements/{AGREEMENT_ID}

Example Request

curl https://api.skveege.com/agreements/agt_123123123 \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728" \
   -X DELETE

Permanently deletes an agreement. It cannot be undone.

Arguments

Field Type Required Description
id string Yes The identifier of the agreement to be deleted.

Returns

Returns an empty response upon success. If the agreement ID does not exist, this call returns an error.

List all agreements

Definition

GET https://api.skveege.com/agreements

Example Request

curl https://api.skveege.com/agreements \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

[
    {
        "id": "agt_123123123",
        "description": "Window Cleaning Outside",
        "amount": 23900,
        "currency": "DKK",
        "contactId": "cot_1231231321",
        "recurrenceRule": "FREQ=WEEKLY;INTERVAL=4;WKST=MO",
        "startDate": "2015-01-01",
        "endDate": null,
        "previousDate": null,
        "nextDate": null,
        "archived": false,
        "accountId": null,
        "meta": {
            "note": "Good Deal"
        }
    },
    {  },
    {  },
    "... And then as many results as available or requested"

]

Returns a list of your agreements.

Arguments

Field Optional Explained
size Yes A limit on the number of objects to be returned. Size can range between 1 and 100 items. Default size is 20.
page Yes A zero-based cursor for use in pagination. Page is a number that defines your place in the list. For instance, if you make a list request and receive 100 objects, your subsequent call can set page=1 in order to fetch the next page of the list.

Returns

An array of up to limit agreements, starting after offset. Each entry in the array is a separate agreement object. If no more agreements are available, the resulting array will be empty. This request should never return an error.

Plan

This resource is a projection of agreements planned for the future. This is a readonly resource.

The plan object

Example Response

{
    "date": "2015-08-01",
    "path": [ [ 10.184501311, 56.15999698 ], [ 10.184513074, 56.160208162 ],.... ] ],
    "contacts": [
        ...
    ]
    "agreements": [
        ...
    ]
}
Field Type Description
date string The date of the plan.
path number The path as coordinates. For use on a fx. a map to show the calculated rod path.
contacts array The contacts refered to by the agreements in this plan.
agreements array The agreements for this plan.

Retrieve a task

Definition

GET https://api.skveege.com/plan

Example Request

curl https://api.skveege.com/plan?date=20015-08-01&accountId \
   -H "X-Auth-Token: test:1427992998230:56caf556bbb8e324929a86adbe80d728"

Example Response

{
    "date": "2015-08-01",
    "path": [ [ 10.184501311, 56.15999698 ], [ 10.184513074, 56.160208162 ],.... ] ],
    "contacts": [
        ...
    ]
    "agreements": [
        ...
    ]
}

Retrieves a plan by date and accountId.

Arguments

Field Type Required Description
date string Yes The date to recieve the plan for.
accountId string Yes The account(worker) to recieve the plan for.

Returns

Returns a plan object.