Customers 1st API (1.0.0)

Download OpenAPI specification:Download

General

Help and support

If you have any questions regarding the API we are happy to help you via our API support at api@c1st.com.

Please be specific and include the following information:

  • A detailed description of the problem with a step-by-step description of what you do and what happens.
  • Store details, specifically the StoreId.
  • If possible, include a complete request and response.
  • Screenshots, if possible.
  • Other relevant or helpful information.

Usage

The API is forward-compatible. We take the freedom to add optional attributes to endpoints without notice. In this case, you should be aware that a PUT request replaces an entire object. i.e. not specifying a field on an object will null the field. To update a single field on e.g. a product you must first GET the product and then PUT the entire product with the new updated field. See example below.

We may introduce breaking changes to endpoints. In such case, you will be contacted via the email provided at the API token setup page with a transition period.

Authentication

Send the header

Authorization: Bearer <token>

<token> can be found at https://app.deltateq.com/en -> Settings -> API -> API users.

We recommend creating a new user for each integration.

Rate limiting

API requests are subject to potential throttling to limit excess load on our servers.

Throttling of requests is based on a simple bucket resource model (similar to the leaking bucket algorithm, except the bucket fills up instead of leaking). You are free to make API requests until the resource bucket is depleted, after which requests will return an HTTP 429 error.

The current bucket size is 80 and the filling (regen) rate is 8 requests per second. These limitations are subject change but are included within the HTTP response for throttled requests:

{
    "error": "API Resource limit reached.",
    "bucket_size:" "80",
    "bucket_regen": "8"
}

We urge you to use the API in a fair manner, and not introducing unnecessary load. Constantly retrieving all data or regularly updating the entire product catalog via bulk operations are examples of what we would consider unfair API usage. Instead, use hooks and only update changed products. Customers 1st monitors API usage to identity excessive API usage. We will try to get in contact on excessive use, but we may be forced to reduce limits until the matter has been resolved.

Configs

A list of settings configs can be found here

Examples

PHP: Update the stock of a product

<?php
class Customers1stException extends Exception
{
    public $err;
    public function __construct($error)
    {
        $this->err = $error;
        parent::__construct($error['message']);
    }
}

class Customers1st
{
    private $token = null;

    function __construct($token)
    {
        $this->token = $token;
    }

    function call($method, $endpoint, $data = false)
    {
        $url = 'https://app.deltateq.com/api' . $endpoint;
        $curl = curl_init();
        switch ($method) {
            case "POST":
                curl_setopt($curl, CURLOPT_POST, 1);
                if ($data) {
                    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
                }
                break;
            case "PUT":
                curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
                if ($data) {
                    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
                }
                break;
            default:
                if ($data) {
                    $url = sprintf("%s?%s", $url, http_build_query($data));
                }
        }
        curl_setopt($curl, CURLOPT_HTTPHEADER, array(
            'Accept: application/json',
            'Content-Type: application/json',
            'Authorization: Bearer ' . $this->token,
        ));
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
        $result = curl_exec($curl);
        $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
        if ($status >= 300) {
            throw new ServicePOSException([
                'endpoint' => $url,
                'status' => $status,
                'error' => $this,
                'method' => 'post',
                'message' => 'Service API',
                'result' => $result
            ]);
        }
        curl_close($curl);
        return json_decode($result, true);
    }
}


try {
    $customers1st = new Customers1st('<token>');

    /* increase stock,
     * If you do not specify the cost price, we use the current average stock price */
    $transaction = [
        'productid' => '<id>',
        'addtostock' => 5,
        'costpriceofaddeditems' => 100,
    ];
    $customers1st->call('POST', '/stocktransactions', ['content' => $transaction]);

    /* decrease stock, costpriceofaddeditems must not be specified */
    $transaction = [
        'productid' => '<id>',
        'addtostock' => -2,
    ];
    $customers1st->call('POST', '/stocktransactions', ['content' => $transaction]);

    /* update a product */
    $product = $customers1st->call('GET', '/products/<id>')['content'];
    $product['title'] = 'New title';
    $product = $customers1st->call('PUT', '/products/<id>', ['content' => $product]);
} catch(Exception $e) {
    echo($e->err['result']);
}

Common Requests

Fetch updated ressources since given timestamp

A common operation you might want to do is fetch all the products from Customers 1st that where changed since the last time you "checked". The way to do this is to use the updated_after query parameter on the products search endpoint. So lets say for example today's date is the 20. of December and you want every product that was changed since the 19. of December. You would make a request like so:

curl \
  -H 'Content-Type: application/json' \
  https://app.deltateq.com/api/products?updated_after=2023-12-19 00:00:00

This would then return a list of products updated after that date. If the amount of products changed are greater than 50 you would still have to paginate through the list using the paginationStart query paramater like usual.

Stock changes

To achive the same for stocktransaction, the request is almost the same as the example above. Here you use the search stockstransactions endpoint with the query paramenter committed_after. So to get all stock transactions after the 19. of December 2023 you would make a request like so:

curl \
  -H 'Content-Type: application/json' \
  https://app.deltateq.com/api/stocktransactions?committed_after=2023-12-19 00:00:00

Pagination

Pagination can be done via GET parameters paginationStart and paginationPageLength. The pagination is based on element count.
For example, if you want to access the third page of a pagination with 10 items per page use:

?pagiationStart=20&paginationPageLength=10

For all endpoints paginationPageLength is limited to 250. We are currently working on implementing this limit.

Hooks

The Customers 1st API supports REST Hooks. This allows you to subscribe to events in our system and get notified via a callback url immediately.

To listen for events,

POST /api/hooks with JSON object

{
    "event": "<event>",
    "url": "<url>"
}

This call returns a unique id for that subscription that is needed to manage the subscription.

When the event triggers in our system, we will POST to the specified url with a relevant payload, for instance the product that was created in case of product.created.

Events can be:

inventorycount.created
inventorycount.updated
inventorycount.deleted
product.created
product.updated
product.deleted
supplier.updated
supplier.deleted
supplier.created
pospayment.created
posbalance.created
customer.created
customer.updated
customer.deleted
shoppinglistorder.created
shoppinglistorder.deleted
shoppinglistitem.created
shoppinglistitem.updated
shoppinglistitem.deleted
customertags.created
customertags.updated
customertags.deleted
customerarticle.created
customerarticle.updated
customerarticle.deleted
taskmaterial.created
taskmaterial.updated
taskmaterial.deleted
task.created
task.updated
task.deleted
taskcomment.created
taskcomment.updated
taskcomment.deleted
servicesubscription.created
servicesubscription.deleted
stocktransaction.committed
giftcard.created
giftcard.updated
giftcard.deleted
loyaltybalance.updated

To unsubscribe DELETE /api/hooks/{id} You can also unsubscribe by returning status code 410 (Gone) when your callback url is notified.

REST hooks can also be specified via the app under Settings -> API.

If the request returns 408 (Request Timeout), 429 (Too Many Requests) or 5xx (Server Error) the server will retry a maximum of 3 times, with an increasing interval of 30, 60, and finally 120 minutes, after which the hook will be considered failed.

Suppress Hooks

When using the API to make changes to your store, for instance create products, these interactions will trigger events like product.created just like using the app would.

In some cases this behaviour is not desired since it can create infinite loops between services, for instance stock sync between Customers 1st and e-conomic.

To avoid this, interact with the API with the following header X-Suppress-Hooks: The content of the header doesn't matter and is ignored.

Validate Hooks

All resthooks from Customers 1st are signed using a store's signing secret. The signature is set in a header called X-C1st-Webhook-Signature. The secret can be changed under api settings or set using the api by changing the store config resthook_signing_secret

To validate a resthook, you need to calculate the HMAC of the request payload using the signing secret.

Here is an example in Laravel/PHP

    public function validateResthook(\Illuminate\Http\Request $request)
    {
        $signature = $request->header('X-C1st-Webhook-Signature');

        $secret = "resthook_super_secret_1337";

        $payload = $request->getContent();
        $calculated_hmac = base64_encode(hash_hmac('sha256', $payload, $secret, true));

        if ($signature != $calculated_hmac) {
            abort(401, 'Webhook failed signature check');
        }
    }

Billing

Deprecated. Get billing data for the store

Responses

Response samples

Content type
application/json
{
  • "warning": "TrialEnded",
  • "active": true,
  • "invoiceDueDate": "string",
  • "trialEnds": "string",
  • "activeModules": {
    },
  • "limits": {
    },
  • "subscription": {
    }
}

Bundle - Experimental

addBundle

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100
paginationPageLength
integer <= 200
Default: 20
Example: paginationPageLength=20
Request Body schema: application/json
object (Bundle)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Bundle

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100
paginationPageLength
integer <= 200
Default: 20
Example: paginationPageLength=20

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

/bundle/{id}

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/bundle/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (Bundle)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

deleteBundle

path Parameters
id
required
integer

Responses

BundleFilter - Experimental

BundleFilter

Request Body schema: application/json
object (BundleFilter)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

/bundlefilter/{id}

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/bundlefilter/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (BundleFilter)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

deleteBundleFilter

path Parameters
id
required
integer

Responses

CustomerArticles

Get list of customer articles

query Parameters
serieno
string
Example: serieno=123abc
paginationPageLength
integer <= 200
customerid
integer
Example: customerid=31241
freetext
string
Example: freetext=Bike Tyson
allowdeleted
boolean
Example: allowdeleted=true
scope
string
Enum: "sharecustomerarticles" "sharecustomers"
updated_after
string
Example: updated_after=2020-01-01 00:00:00

Get all customer articles updated after the given date

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Create a new customer article

Request Body schema: application/json
object (CustomerArticle)
object (ServiceSubscription)
removesubscription
boolean or null

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "createsubscription": {
    },
  • "removesubscription": true
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete customer articles

Request Body schema: application/json
content
Array of integers

Array of customer article ids

Responses

Request samples

Content type
application/json
{
  • "content": [
    ]
}

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Switch customer of a customer article

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
newCustomerId
required
integer

The ID of the new customer to transfer the customer article to

transferServiceNotifications
integer
Default: 0

If not 0, the service notifications will be transferred to the new customer

Responses

Request samples

Content type
application/json
{
  • "newCustomerId": 1,
  • "transferServiceNotifications": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a customer article

path Parameters
id
required
integer >= 0

Id to the relevant resource

query Parameters
allowdeleted
boolean
Example: allowdeleted=true or 1
withdraftsubscription
boolean
Example: withdraftsubscription=true or 1

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Update a customer article

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object (CustomerArticle)
object (ServiceSubscription)
removesubscription
boolean or null

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "createsubscription": {
    },
  • "removesubscription": true
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a customer article

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

CustomerTags

Get list of customer tags used by the store

query Parameters
freetext
string

Search string

paginationStart
number
Default: 0

Start of pagination

paginationPageLength
number
Default: 1000

Pagination page length

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Add a new customer tag to the store

Request Body schema: application/json
title
required
string

The title of the tag

id
integer or null

The id of the tag

handle
string or null

Unique handle for the produttag. Will be set automatically if not set. This value cannot be changed once set.

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "id": 0,
  • "handle": "string"
}

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Get a customer tag

path Parameters
tagId
required
integer

The tag ID

Responses

Response samples

Content type
application/json
{
  • "title": "string",
  • "id": 0,
  • "handle": "string"
}

Delete a customer tag from the store

path Parameters
tagId
required
integer

The tag ID

Responses

Response samples

Content type
application/json
{ }

Update a customer tag

path Parameters
tagId
required
integer

The tag ID

Request Body schema: application/json
title
required
string

The title of the tag

id
integer or null

The id of the tag

handle
string or null

Unique handle for the produttag. Will be set automatically if not set. This value cannot be changed once set.

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "id": 0,
  • "handle": "string"
}

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Customers

Search for customers

query Parameters
count
boolean
Deprecated
Default: true
Example: count=true

Return the count or not. More slow, consider using thasMore for pagination

filter
string
Deprecated

Filter expression. See https://restdocs.e-conomic.com/#filtering. In and Not In are not supported.

paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of products) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of products to fetch in one page.

sortOrder
integer
Default: 1
Enum: -1 1
Example: sortOrder=1

Sorting order. If order is 1, products are retrieved in ascending order, if -1, in descending order.

customerno
string
sortField
string
Example: sortField=id

Sort by field.

allowMarketing
boolean
Example: allowMarketing=true

Filter for marketing consented customers only.

name
string

Freetext search for customer name

email
string

Freetext search for customer email

phoneno
string

Search for customer phone number

ean
string

Search for customers EAN

cvr
string

Search for customers CVR

tags
string

Customer tags as a comma-separated string

freetext
string

Freetext search for customer, this searches in most customer properties like name, address, phone, email etc

partOfLoyaltyClub
boolean

Filter for customers who are in loyalty club

updated_after
string
Example: updated_after=2020-01-01 00:00:00

Get all customers updated after the given date

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Add a new customer

Request Body schema: application/json
object (Customer)

The representation of a customer.

synctoeconomic
boolean or null

Whether or not it should be synced to economic, default is false

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "synctoeconomic": true
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a customer

path Parameters
customerId
required
integer

The customer ID

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Replace a customer

path Parameters
customerId
required
integer

The customer ID

Request Body schema: application/json
object (Customer)

The representation of a customer.

synctoeconomic
boolean or null

Whether or not it should be synced to economic, default is false

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "synctoeconomic": true
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a customer

path Parameters
customerId
required
integer

The customer ID

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

CustomFields

Get a list of all customfields.

query Parameters
endpoint
string
Default: "product"

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Edit customfield

path Parameters
endpoint
required
string^(product|customerarticle)$
attribute
required
string^customfield[1-4]$
Request Body schema: application/json
object (CustomField)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

DiscountTags

addDiscountTag

Request Body schema: application/json
object (DiscountTag)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

DiscountTags

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

/discounttags/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (DiscountTag)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

discounttags

path Parameters
id
required
integer

Responses

Finance

Get finance voucher for a balance

path Parameters
balanceid
required
integer

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GiftCards

searchGiftcard

Search for giftcards

query Parameters
freetext
string

The free text that is used to search in name, type, giftcardno, phone etc.

fromdate
string
Example: fromdate=2020-01-01 00:00:00

date

todate
string
Example: todate=2020-01-01 23:59:59

date

giftcardid
integer

filter on id

customerid
integer

filter on customerid

giftcardno
string

filter on id

paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of item) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of items to fetch in one page.

sortOrder
integer
Default: 1
Enum: -1 1
Example: sortOrder=1

Sorting order. If order is 1, items are retrieved in ascending order, if -1, in descending order.

sortField
string
Example: sortField=id

Sort by field e.g. giftcardno, date,..

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

createGiftcard

Create a giftcard

Request Body schema: application/json
object (Giftcard)

A giftcard

Responses

Request samples

Content type
application/json

Create a giftcard with amount of 200

{
  • "content": {
    }
}

Response samples

Content type
application/json

Add a giftcard with amount of 200

{
  • "content": {
    }
}

Update a giftcard

Update a giftcard

path Parameters
giftcardId
required
integer

The giftcard ID

Request Body schema: application/json
object (Giftcard)

A giftcard

Responses

Request samples

Content type
application/json

Set the amount spent on a giftcard to 80 and leave the balance at 120

{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

getGiftcard

Get giftcards

path Parameters
giftcardId
required
integer

The giftcard id

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

RestHooksLog

List current REST hook log entries for store.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

RestHooks

Get the list of valid events.

Responses

Response samples

Content type
application/json
{
  • "items": [
    ]
}

List current subscriptions for store.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0
}

Subscribe to event

Subscribe to an event like product.created with a callback url to get pinged when the event triggers.

Request Body schema: application/json
event
string

The event being listened for.

url
string

The event being listened for.

receiver
string or null

An identifier to distinguish different receivers.

active
integer
Enum: 0 1

Whether or not the hook is enabled.

Responses

Callbacks

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "id": 1
}

Get subscription

Get the subscription details for given an id.

path Parameters
hookId
required
integer

Responses

Response samples

Content type
application/json
{
  • "id": 123,
  • "event": "product.created",
  • "receiver": "zapier",
  • "active": 1,
  • "created": "2019-01-01 12:00:00",
  • "lastactivity": "2019-01-01 12:00:00",
  • "last_updated": "2019-01-01 12:00:00"
}

Update subscription

Update the subscription for an event given an id.

path Parameters
hookId
required
integer
Request Body schema: application/json
event
string

The event being listened for.

url
string

The event being listened for.

receiver
string or null

An identifier to distinguish different receivers.

active
integer
Enum: 0 1

Whether or not the hook is enabled.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "updated": 1
}

Unsubscribe from event

Unsubscribe from an event given an id for subscription.

path Parameters
hookId
required
integer

Responses

Response samples

Content type
application/json
{
  • "deleted": 1
}

Loyalty

Withdraw a customer from the loyalty program

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Enroll a customer into the loyalty program

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Get loyalty transactions of the customer

path Parameters
id
required
integer >= 0

Id to the relevant resource

query Parameters
paginationStart
number
Default: 0

Start of pagination

paginationPageLength
number
Default: 1000

Pagination page length

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "balance": 0,
  • "count": 0,
  • "hasMore": true,
  • "ispartofloyaltyclub": true
}

Create a new transaction on this user

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object (CreateLoyaltyTransactionRequest)

The hook information expected when subscribing to an event.

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Notifications

Get recent notifications for the current user

query Parameters
userid
integer

The user ID

updated_after
string

Get alle notification updated after a certain date

created_after
string

Get alle notification created after a certain date

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Get the settings object describing which users are listening to what notifications

Responses

Response samples

Content type
application/json
{ }

Update the settings object describing which users are listening to what notifications

Request Body schema: application/json
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{ }

PartnerInventory

Get inventory levels for partner stores matched on

Get inventory levels for partner stores matched on product number. If a product has serial products the endpoint will return the inventory sum of all those serial products

path Parameters
productid
required
integer

The product ID

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "totalstock": 0,
  • "totalreserved": 0,
  • "totalavailable": 0
}

PartnerPermissions

/partnerpermissions/derived

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

PaymentTypes

Get a list of all the store's payment types.

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Create a payment type

Request Body schema: application/json
title
string

The name of a payment type

accountno
string or null

The account number associated with the payment type

currency
string or null

The currency associated with the payment type

exchangerate
number or null

The exchange rate of the given currency (if any) to the store's main currency.

cash
integer
Default: 0

Whether or not the payment type is physical cash

Responses

Request samples

Content type
application/json
{
  • "title": "Cash",
  • "accountno": 1234,
  • "currency": "DKK",
  • "exchangerate": 7.5,
  • "cash": 0
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Cash",
  • "accountno": 1234,
  • "currency": "DKK",
  • "exchangerate": 7.5,
  • "cash": 0,
  • "disabled": 0
}

Get a list of all the store's payment types.

path Parameters
id
required
integer
query Parameters
allowDeleted
integer

Includes deleted payment types in the response when not 0

Responses

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Cash",
  • "accountno": 1234,
  • "currency": "DKK",
  • "exchangerate": 7.5,
  • "cash": 0,
  • "disabled": 0
}

Edit an exisiting payment type

path Parameters
id
required
integer

The PaymentType ID

query Parameters
allowDeleted
integer

Allows for settings deleted payment types when not 0

Request Body schema: application/json
title
string

The name of a payment type

accountno
string or null

The account number associated with the payment type

currency
string or null

The currency associated with the payment type

exchangerate
number or null

The exchange rate of the given currency (if any) to the store's main currency.

cash
integer
Default: 0

Whether or not the payment type is physical cash

Responses

Request samples

Content type
application/json
{
  • "title": "Cash",
  • "accountno": 1234,
  • "currency": "DKK",
  • "exchangerate": 7.5,
  • "cash": 0
}

Response samples

Content type
application/json
{
  • "id": 1,
  • "title": "Cash",
  • "accountno": 1234,
  • "currency": "DKK",
  • "exchangerate": 7.5,
  • "cash": 0,
  • "disabled": 0
}

Delete a payment type

path Parameters
id
required
integer

The PaymentType ID

Responses

Response samples

Content type
application/json
{
  • "deleted": 1
}

PaymentTypeRelations

Add a list of articles to an existing payment

path Parameters
paymentId
required
integer >= 0

payment id

query Parameters
getreceipts
boolean

Whether or not to include receipts

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Add a list of payments to an existing payment

path Parameters
paymentId
required
integer >= 0

payment id

Request Body schema: application/json
Array
id
integer or null
title
string

The title of the payment. E.g. 'cash' or 'Dankort'

paymenttypeid
integer or null

reference to user created payment type.

amount
number <double>

The amount of the payment type.

cash
integer

Returns whether or not the payment type is cash-based.

bamdesk_messageid
integer or null

If provider = 'bamdesk'. This will be the id for the messageid for Worldline card-terminal.

accountno
string or null

The account where the payment has been posted. If not applicable, it will be null.

currency
string or null

3-digit currency code if the payment is in foreign currency.

exchangerate
number or null <double>

The exchange rate if the payment is in foreign currency

receipts
Array of strings or null

Index for where it's stored.

error_message
string or null

If an error occured during the payment, this will contain the error message, if supported by the provider.

(PaymentProvider (string or null)) or (string or null)
status
string
Default: "captured"
Enum: "initiated" "reserved" "cancelled" "captured"

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Changes status of a payment

Can only change the status of a payment if it is not captured

path Parameters
paymentId
required
integer >= 0

payment id

Request Body schema: application/json
id
integer or null
title
string

The title of the payment. E.g. 'cash' or 'Dankort'

paymenttypeid
integer or null

reference to user created payment type.

amount
number <double>

The amount of the payment type.

cash
integer

Returns whether or not the payment type is cash-based.

bamdesk_messageid
integer or null

If provider = 'bamdesk'. This will be the id for the messageid for Worldline card-terminal.

accountno
string or null

The account where the payment has been posted. If not applicable, it will be null.

currency
string or null

3-digit currency code if the payment is in foreign currency.

exchangerate
number or null <double>

The exchange rate if the payment is in foreign currency

receipts
Array of strings or null

Index for where it's stored.

error_message
string or null

If an error occured during the payment, this will contain the error message, if supported by the provider.

(PaymentProvider (string or null)) or (string or null)
status
string
Default: "captured"
Enum: "initiated" "reserved" "cancelled" "captured"

Responses

Request samples

Content type
application/json
{
  • "id": 0,
  • "title": "Cash",
  • "paymenttypeid": 0,
  • "amount": 123.45,
  • "cash": 0,
  • "bamdesk_messageid": 4343,
  • "accountno": "1234",
  • "currency": "DKK",
  • "exchangerate": 0,
  • "receipts": [
    ],
  • "error_message": "string",
  • "provider": "mobilepay",
  • "status": "initiated"
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "title": "Cash",
  • "paymenttypeid": 0,
  • "amount": 123.45,
  • "unroundedcash": 123,
  • "cash": 0,
  • "bamdesk_messageid": 4343,
  • "accountno": "1234",
  • "currency": "DKK",
  • "exchangerate": 0,
  • "receipts": [
    ],
  • "receiptsCount": 0,
  • "mobilepayid": "string",
  • "paymentid": 0,
  • "stripe_intentsecret": "string",
  • "stripe_intentid": "string",
  • "vipps_reference_id": "string",
  • "error_message": "string",
  • "provider": "mobilepay",
  • "status": "initiated"
}

Gets receipt for a paymenttyperelation

path Parameters
id
required
integer

The ID

Responses

Response samples

Content type
application/json
[
  • "string"
]

POSBalances

Search for balances

Get balances. Balances are readonly and can only be created via Customers 1st app

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of item) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of items to fetch in one page.

sortOrder
integer
Default: 1
Enum: -1 1
Example: sortOrder=1

Sorting order. If order is 1, items are retrieved in ascending order, if -1, in descending order.

sortField
string
Example: sortField=id

Sort by field e.g. date,...

userId
integer
Example: userId=1

Id of the cashier

cashRegisterId
integer
Example: cashRegisterId=2

Id of the cash register

toDate
string
Example: toDate=2020-01-01 23:59:59

Get all payments before the given date

fromDate
string
Example: fromDate=2020-01-01 23:59:59

Get all payments after the given date

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

POSPayments

Add a list of articles to an existing payment.

path Parameters
paymentId
required
integer >= 0

payment id

Request Body schema: application/json
Array
title
string

The title of the article sold

price
number <double>

Price of the article. By default price includes VAT but can be changed in the store config "prices_include_vat".

costprice
number or null <double>

The cost price of the article sold

quantity
number

Number of articles sold.

vat
number <double> [ 0 .. 100 ]

VAT percentage.

vatmode
string (VATMode)
Enum: "normal" "second_hand"

< normal vat calculation is based on price second_hand vat calulation is based on price - costprice

giftcardno
string or null
Deprecated

Provide this if you want to issue a giftcard with the payment. The amount on the giftcard will be the value of price.

usedGiftcardId
integer or null
Deprecated

Provide this if you want use a giftcard as means of payment. The value of price will be deducted from the giftcard balance

object (Giftcard)

A giftcard

giftcardid
integer or null

Id of issued giftcard

object (Giftcard)

A giftcard

customerarticleid
integer or null

Id of the attached customerarticle

productno
string or null
Deprecated

For legacy support, instead refer to product.productno. This is only used for voucher and deposit

productid
integer or null

< The the id of the product you want to sell. Stock will be deducted from the product after succesful payment. Deleted products are allowed. This is useful for return sales and payments of tickets with deleted products.

object (Product)

The representation of a product.

taskmaterialid
integer or null

Relate the payment article to a taskmaterial. Use this to keep track of the payment status of task.

discountToken
number
Deprecated
discountedToken
number or null
Deprecated
paymentid
integer or null
deletedpromotion
integer or null

If a promotion is deleted from an article, this is set to 1, thus no further promotions will be applied to it

discounttagid
integer or null
object (DiscountTag)
promotionid
integer or null
object (TicketMaterial)
bundleid
integer or null
type
string or null

Can either be "recurringpaymentterm", "newservicesubscription" or "newrecurringpayment"

recurringpaymentid
integer or null

The id of the recurring payment

servicesubscriptionid
integer or null

The id of the servicesubscription to be activated when payment completed

object (ServiceSubscription)

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

Search for payments

Get payments.

query Parameters
freetext
string

The free text that is used to search in paymentno, payment materials, etc.

fromdate
string
Example: fromdate=2020-01-01 00:00:00

Get all payments after the given fromdate to now (or to todate if specified)

cash
integer

1 of you only want cash payments

invoice
integer
Example: invoice=1

1 of you only want invoice payments

todate
string
Example: todate=2020-01-01 23:59:59

Get all payments before the given todate

productid
integer

Get payments of a specific product

paymentno_after
integer >= 0

Get all payments with paymentno >= paymentno_after

updated_after
string
Example: updated_after=2020-01-01 00:00:00

Get all payments updated after the given date

userid
integer

filter on userid

customerid
integer

filter on customerid

customerPaymentSum
integer
Default: 0

Calculate total payment sum for customer, requires that customerid is provided

paymenttypeid
integer

Filter on paymenttype

bamdeskdevice
integer

1 = only get bamdeskdevice payments

fromPartnerStores
integer
Default: 0

Includes payments from partner stores when not 0

extra
integer
Default: 0
Example: extra=1

Includes articles and taskIds when not 0. Note that this can be expensive

paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of item) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of items to fetch in one page.

sortOrder
integer
Default: 1
Enum: -1 1
Example: sortOrder=1

Sorting order. If order is 1, items are retrieved in ascending order, if -1, in descending order.

sortField
string
Example: sortField=id

Sort by field e.g. paymentno, date,.

cashRegisterId
number
Example: cashRegisterId=1

Get payments with a specific cash register

status
string (PaymentStatus)
Enum: "initialized" "parked" "in_progress" "completed" "cancelled"
Example: status=completed

Get payments with a specific status

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true,
  • "totalcustomerpaymentsum": 0
}

Add a new POS payment

Add a new payment. For a payment use must provide the products sold via articles and the payment transactions via paymenttypes

Request Body schema: application/json
customerid
integer or null

The id of the customer if any was attached to the payment

remainingamount
number or null

The amount left to pay for the payment

cashRegisterId
integer or null

The id of the cash register used for the payment. Provide null if you don't use cash regiters

updated_at
string or null^\d{4}-\d{2}-\d{2}[T ]?\d{2}:\d{2}:\d{2}

Timestamp for when the last time the payment is updated.

invoice
integer

1 if payment is a invoice payment. For example if the payment is paid via an invoice in economic.

customerpayment
integer
Default: 0

1 if payment is a customer payment

object (Customer)

The representation of a customer.

Array of objects or null (PaymentArticle)

The list of payment articles. Those are the products sold with the payment. When you POST a payment this will be the list of articles sold Note: When get GET payments we only provide this if you add query parameter ?extra=1

taskids
Array of integers

An optional list of ticket id attached to the payment. Note: When get GET payments we only provide this if you add query parameter ?extra=1

Array of objects or null (PaymentTypeRelation)

A list of payment transactions used as means of payments.

cash
integer or null
Deprecated

Deprecated. To be removed soon

secondhand
integer or null

Set to 1 i f the return of the payment has secondhand products (only necessary to set if you want statistics of secondhand sales)

status
string (PaymentStatus)
Enum: "initialized" "parked" "in_progress" "completed" "cancelled"
returnpaymentid
integer or null

A reference ID to the POSPayment being returned. Only relevant for return sales.

lastmodifiedbyuserid
integer or null

ID of the user who last modified the payment by changing the status from in_progress to complete/cancelled

note
string or null

A piece of text attached to the payment.

permission
string (PartnerPermissionAccess)
Enum: "none" "readonly" "full"

Responses

Request samples

Content type
application/json

Sell wine with cash payment

{
  • "articles": [
    ],
  • "paymenttypes": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 0,
  • "paymentno": 0,
  • "userid": 1,
  • "customerid": 1,
  • "date": "string",
  • "numberofmaterials": 1,
  • "sum": 1,
  • "discountsum": 0,
  • "remainingamount": 0,
  • "cashRegisterId": 1,
  • "cashRegisterTitle": "string",
  • "updated_at": "2022-03-10 00:00:00",
  • "invoice": 0,
  • "customerpayment": 0,
  • "cashregister": {
    },
  • "user": {
    },
  • "customer": {
    },
  • "articles": [
    ],
  • "taskids": [
    ],
  • "paidwithcash": 0,
  • "paymenttypes": [
    ],
  • "storeid": 0,
  • "customerpaymentsum": 0,
  • "cash": 0,
  • "secondhand": 0,
  • "status": "initialized",
  • "returnpaymentid": 0,
  • "lastmodifiedbyuserid": 0,
  • "lastmodifiedbyuser": {
    },
  • "note": "string",
  • "permission": "none"
}

Get a payment

path Parameters
paymentId
required
integer >= 0

payment id

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Changes payment

path Parameters
paymentId
required
integer >= 0

payment id

Request Body schema: application/json
object (POSPayment)

The representation of a POS sale

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Cart

a new cart.

path Parameters
paymentId
required
integer >= 0

payment id

paymentArticleId
required
integer >= 0

Payment article id

Request Body schema: application/json
object (PaymentArticle)

The representation of a POS article

To issue/sell giftcards If you want to issue a gift card, sell a article with productno either 'giftcard', 'voucher', or 'deposit' and provide a unique giftcard number as value of giftcardno. Quantity must be 1 If you want to return a giftcard set giftcardid and quantity to -1. Price must be positive If you want to use a giftcard set usedGiftcardId and quantity to 1. Price must be be negative any other value for quantiy and price for giftcards will fail.

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

a new cart.

path Parameters
paymentId
required
integer >= 0

payment id

paymentArticleId
required
integer >= 0

Payment article id

Responses

a new cart.

path Parameters
paymentArticleId
required
integer >= 0

Payment article id

paymentId
required
integer >= 0

payment id

Request Body schema: application/json
title
string
discount
number
discounttagid
integer or null

Which discount tag that should be applied to the discount

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "discount": 0,
  • "discounttagid": 0
}

a new cart.

path Parameters
paymentId
required
integer >= 0

payment id

Request Body schema: application/json
title
string
discount
number
discounttagid
integer or null

Which discount tag that should be applied to the discount

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "discount": 0,
  • "discounttagid": 0
}

a new cart.

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
title
string
discount
number
discounttagid
integer or null

Which discount tag that should be applied to the discount

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "discount": 0,
  • "discounttagid": 0
}

POSRegisters

Get a list of all the store's POS registers.

query Parameters
includeDeleted
boolean
Default: false

Include deleted cash registers in request

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Create a new POSRegister

Request Body schema: application/json
object (POSRegister)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Edit an exisiting POS register

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object (POSRegister)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a POS register based on id

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Deletes a POS register based on id

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

ProductImage

Get a products image

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    },
  • "message": "string"
}

Delete a products image

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Set a product image from a url. This is done Async.

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object
setatpartners
boolean
Default: false

Whether or not to update the image for partner products - if true this only updates the image, not any other properties

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "setatpartners": false
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "message": "string"
}

Products

Get addons for a specific product

path Parameters
id
required
integer

The product ID

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of products) to fetch. This is usually a multiple of the pageLength. For legacy support you can also write pagination-start

paginationPageLength
integer <= 250
Default: 50
Example: paginationPageLength=30

Determine the number of products to fetch in one page. For legacy support you can also write pagination-PageLength

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "hasMore": true
}

Add a new add-on to a specific product

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
addonproductid
integer

The id of the addon to add.

amount
integer or null

The amount

addonprice
number or null <double>

A custom price

Responses

Request samples

Content type
application/json
{
  • "addonproductid": 0,
  • "amount": 0,
  • "addonprice": 0
}

Get the number of addons for a specific product

path Parameters
id
required
integer

The product ID

Responses

Response samples

Content type
application/json
{
  • "count": 0
}

Replace products in chunks

Request Body schema: application/json
Array of objects (SetProductBulkItem) <= 100 items

The body of the request used to create/update products.

Responses

Request samples

Content type
application/json
{
  • "content": [
    ]
}

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Patch products in bulk

Request Body schema: application/json
Array of objects (SetProductBulkItem) <= 100 items

The body of the request used to create/update products.

Responses

Request samples

Content type
application/json
{
  • "content": [
    ]
}

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Delete products in chunks

query Parameters
ids
Array of strings <= 100 items

Pipe separated list of ids

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Search for product

query Parameters
barcode
string

Barcode

brand
string

Brand

color
string
size
string
customfield1
string
customfield2
string
customfield3
string
customfield4
string
count
boolean
Deprecated
Default: true
Example: count=true

Return the count or not.

freetext
string

Freetext search used to find what humans expect. NB this can change over time, don't use this in your integration on this.

id
integer

The ID of the product.

inStock
boolean

Only retrieve products that are currently in stock.

needsOrdering
boolean

Only retrieve products that needs to be ordered because of low stock.

paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of products) to fetch. This is usually a multiple of the pageLength. For legacy support you can also write pagination-start

paginationPageLength
integer <= 250
Default: 50
Example: paginationPageLength=30

Determine the number of products to fetch in one page. For legacy support you can also write pagination-PageLength

productNo
Array of strings <= 100

Pipe separated list of product numbers.

styleNo
Array of strings <= 100

Pipe separated list of style numbers.

serieNo
string

Serie-number

hasSerieNo
boolean

Return products that has a serie-number

needsrrppriceupdate
boolean

Return products that have a recommended retail price and the recommended retail price does not match the products price

stocktransactionlistid
integer

Search in stocktransactionlist, this will only search on products that are a part of a stocktransactionlist with this id

sort-order
integer
Default: 1
Enum: -1 1
Example: sort-order=1

Sorting order. If order is 1, products are retrieved in ascending order, if -1, in descending order.

sort-field
string
Example: sort-field=id

Sort by field.

suppliername
string

Name of the supplier.

tag
string

Tag.

tags
Array of strings <= 100 items

List of tags to restrict the search to.

supplierid
string

Supplier.

partnerstoreid
string

List products for partner store.

vatmode
string
Enum: "normal" "second_hand"

VAT mode

updated_after
string
Example: updated_after=2020-01-01 00:00:00

Get all products updated after the given date

created_before
string
Example: created_before=2020-01-01 00:00:00

Get all products created before the given date

updated_before
string
Example: updated_before=2020-01-01 00:00:00

Get all products updated before the given date

getDiscountPrice
boolean
Example: getDiscountPrice=true

Whether to include discountprice for the products

hasSyncproductdatawebshop
boolean
Example: hasSyncproductdatawebshop=true

If given, only get products that has/has not syncproductdatawebshop set

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Add a new product

Request Body schema: application/json
object (Product)

The representation of a product.

stocktransactiontagid
number or null
Default: null
resthookmetadata
string <= 255 characters
Default: "{}"

The string content has to be valid JSON. It can contain whatever meta data a resthook could use. For example, 'syncproductdatawebshop' could be set to true, so the function, that receives the resthook, knows whether or not to sync a given product.

stocktransactionreason
string <= 255 characters

The reason why the product stock was updated. This will be saved in the product stock transaction log.

stocknochangeisrelative
boolean
Deprecated
Default: false

If true, the Product.stockno update is interpreted as relative to its previous value; for example, if the previous value was 40 and you pass Product.stockno=42, it's interpreted as adding 2 (e.g. receiving 2 items from a supplier), and if you pass Product.stockno=38, it's interpreted as removing 2 (e.g. selling 2 items). If stocknochangeisrelative is false, the change is interpreted as absolute, e.g. with the intention of setting the initial value or correcting a wrong number. Note it has no direct effect on how Customers 1st functions; Product.stockno will always be set to the specified value; but it affects REST hooks (product.updated events) and 3rd party integrations if they distinguish between absolute and relative changes in the number of items in stock. See also stocknochangetype in Product.

orderid
integer

A reference to the shopping list item id for which this product stock has been updated.

setatpartners
boolean
Default: false

Create/update relavant product data at partner stores

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "allow_edit_productno_and_serieno": true
}

Get a product

path Parameters
productId
required
integer

The product ID

query Parameters
includeDiscountPrice
integer

Includes discountprice of a product. If set to 1, the discountprice is included, otherwise it is not included.

Responses

Response samples

Content type
application/json
{
  • "content": {
    },
  • "allow_edit_productno_and_serieno": true
}

Update selected fields for a product

path Parameters
productId
required
integer

The product ID

Request Body schema: application/json
object (Product)

The representation of a product.

stocktransactiontagid
number or null
Default: null
resthookmetadata
string <= 255 characters
Default: "{}"

The string content has to be valid JSON. It can contain whatever meta data a resthook could use. For example, 'syncproductdatawebshop' could be set to true, so the function, that receives the resthook, knows whether or not to sync a given product.

stocktransactionreason
string <= 255 characters

The reason why the product stock was updated. This will be saved in the product stock transaction log.

stocknochangeisrelative
boolean
Deprecated
Default: false

If true, the Product.stockno update is interpreted as relative to its previous value; for example, if the previous value was 40 and you pass Product.stockno=42, it's interpreted as adding 2 (e.g. receiving 2 items from a supplier), and if you pass Product.stockno=38, it's interpreted as removing 2 (e.g. selling 2 items). If stocknochangeisrelative is false, the change is interpreted as absolute, e.g. with the intention of setting the initial value or correcting a wrong number. Note it has no direct effect on how Customers 1st functions; Product.stockno will always be set to the specified value; but it affects REST hooks (product.updated events) and 3rd party integrations if they distinguish between absolute and relative changes in the number of items in stock. See also stocknochangetype in Product.

orderid
integer

A reference to the shopping list item id for which this product stock has been updated.

setatpartners
boolean
Default: false

Create/update relavant product data at partner stores

Responses

Request samples

Content type
application/json

Overwrite stock number of wine

{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "allow_edit_productno_and_serieno": true
}

Replace a product

path Parameters
productId
required
integer

The product ID

Request Body schema: application/json
object (Product)

The representation of a product.

stocktransactiontagid
number or null
Default: null
resthookmetadata
string <= 255 characters
Default: "{}"

The string content has to be valid JSON. It can contain whatever meta data a resthook could use. For example, 'syncproductdatawebshop' could be set to true, so the function, that receives the resthook, knows whether or not to sync a given product.

stocktransactionreason
string <= 255 characters

The reason why the product stock was updated. This will be saved in the product stock transaction log.

stocknochangeisrelative
boolean
Deprecated
Default: false

If true, the Product.stockno update is interpreted as relative to its previous value; for example, if the previous value was 40 and you pass Product.stockno=42, it's interpreted as adding 2 (e.g. receiving 2 items from a supplier), and if you pass Product.stockno=38, it's interpreted as removing 2 (e.g. selling 2 items). If stocknochangeisrelative is false, the change is interpreted as absolute, e.g. with the intention of setting the initial value or correcting a wrong number. Note it has no direct effect on how Customers 1st functions; Product.stockno will always be set to the specified value; but it affects REST hooks (product.updated events) and 3rd party integrations if they distinguish between absolute and relative changes in the number of items in stock. See also stocknochangetype in Product.

orderid
integer

A reference to the shopping list item id for which this product stock has been updated.

setatpartners
boolean
Default: false

Create/update relavant product data at partner stores

Responses

Request samples

Content type
application/json

Overwrite stock number of wine

{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "allow_edit_productno_and_serieno": true
}

Delete a product

path Parameters
productId
required
integer

The product ID

Responses

Response samples

Content type
application/json
{
  • "content": {
    },
  • "allow_edit_productno_and_serieno": true
}

ProductAddon

Edit a addon relation

path Parameters
productId
required
integer

The product ID

addonId
required
integer

The add-on id

Request Body schema: application/json
amount
integer
addonprice
number or null <double>
object (Product)

The representation of a product.

Responses

Request samples

Content type
application/json
{
  • "amount": 0,
  • "addonprice": 0,
  • "product": {
    }
}

Delete a specific addon for a specific product

path Parameters
productId
required
integer

The product ID

addonId
required
integer

The add-on id

Responses

ProductMasterData

Add or update product master data. Update is triggered if {suppliername, productno, industry, country} matches existing item

Request Body schema: application/json
suppliername
required
string <= 255 characters

Name of supplier

tags
Array of strings or null <= 15 items
title
string <= 255 characters

Name of product

productno
required
string

Product id

barcode
string or null

Barcode

alternativebarcode
string or null

Barcode

brand
string or null <= 100 characters

Brand

suggestedprice
number or null <double>

The suggested price

price
number or null <double>

The actual price

color
string or null <= 255 characters

Color

size
string or null <= 255 characters

Size

styleno
string or null <= 255 characters

Style number

vat
number or null <double>

VAT in percent

industry
required
string <= 255 characters

Industry. Examples: bikeshop, garden, phone, jewelry, generic.

country
required
string <= 255 characters

Country. Examples: dk, en.

year
integer or null

Year

imageurl
string or null

The url from which to fetch the image

customfield1
string or null
customfield2
string or null
customfield3
string or null
customfield4
string or null

Responses

Request samples

Content type
application/json
{
  • "suppliername": "DanishBikeSupplier",
  • "tags": [
    ],
  • "title": "string",
  • "productno": "string",
  • "barcode": "string",
  • "alternativebarcode": "string",
  • "brand": "string",
  • "suggestedprice": 0,
  • "price": 0,
  • "color": "string",
  • "size": "string",
  • "styleno": "string",
  • "vat": 25,
  • "industry": "bikeshop",
  • "country": "dk",
  • "year": 2019,
  • "customfield1": "Gear",
  • "customfield2": "123123",
  • "customfield3": "123123",
  • "customfield4": "Gold wheels"
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "status": "string"
}

Search the productmasterdata

query Parameters
search
string

The search string

barcode
string

A secondary search string that only searches in the barcode field

pagelength
integer

The pagination page length

offset
integer

The pagination object offset

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "hasMore": true
}

Add or update product master data in bulk. Update is triggered if {suppliername, productno, industry, country} matches existing item

Request Body schema: application/json
Array (<= 1000 items)
suppliername
required
string <= 255 characters

Name of supplier

tags
Array of strings or null <= 15 items
title
string <= 255 characters

Name of product

productno
required
string

Product id

barcode
string or null

Barcode

alternativebarcode
string or null

Barcode

brand
string or null <= 100 characters

Brand

suggestedprice
number or null <double>

The suggested price

price
number or null <double>

The actual price

color
string or null <= 255 characters

Color

size
string or null <= 255 characters

Size

styleno
string or null <= 255 characters

Style number

vat
number or null <double>

VAT in percent

industry
required
string <= 255 characters

Industry. Examples: bikeshop, garden, phone, jewelry, generic.

country
required
string <= 255 characters

Country. Examples: dk, en.

year
integer or null

Year

imageurl
string or null

The url from which to fetch the image

customfield1
string or null
customfield2
string or null
customfield3
string or null
customfield4
string or null

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
[
  • {
    }
]

ProductTags

Get list of product tags used by the store

query Parameters
handles
Array of strings <= 100

Pipe separated list of tag handles.

ids
Array of strings <= 100

Pipe separated list of ids handles.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Create a new product tag

Request Body schema: application/json
title
string

The title of the tag

id
integer or null

The ID of the tag

accountno
integer or null

The accountno used for book keeping

object or null (PromotionTagFilter)
handle
string or null

Unique handle for the produttag. Will be set automatically if not set. The handle is write once, and can not be changed after the tag is created.

position
number or null

Number used to determine order of product tags.

positionafterid
number or null

If this is set, the position of this product tag will be between positionafterid and the tag below if it exists.

positionbeforeid
number or null

If this is set, the position of this product tag will be between positionbeforeid and the tag above if it exists.

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "id": 0,
  • "accountno": 0,
  • "promotionfilter": {
    },
  • "handle": "string",
  • "position": 23.04,
  • "positionafterid": 0,
  • "positionbeforeid": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a product tag used by the store

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a product tag

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Update a product tag

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
title
string

The title of the tag

id
integer or null

The ID of the tag

accountno
integer or null

The accountno used for book keeping

object or null (PromotionTagFilter)
handle
string or null

Unique handle for the produttag. Will be set automatically if not set. The handle is write once, and can not be changed after the tag is created.

position
number or null

Number used to determine order of product tags.

positionafterid
number or null

If this is set, the position of this product tag will be between positionafterid and the tag below if it exists.

positionbeforeid
number or null

If this is set, the position of this product tag will be between positionbeforeid and the tag above if it exists.

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "id": 0,
  • "accountno": 0,
  • "promotionfilter": {
    },
  • "handle": "string",
  • "position": 23.04,
  • "positionafterid": 0,
  • "positionbeforeid": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Promotions

List promotions for store.

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of items) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of item to fetch in one page.

allowDeleted
integer
Default: 0

Optional. If equal to 1, deleted promotions will be included in the response.

freeText
string

Optional. Search for promotion name, product, brand, tag and customer group

actionType
string
Enum: "percentage" "adjustPriceBy" "percentageByCostprice" "totalPriceUnit"

Optional. Search promotions by its action type

startDate
string

Optional. Search promotions by start date (format YYYY-MM-DD HH:MM:SS)

endDate
string

Optional. Search promotions by end date (format YYYY-MM-DD HH:MM:SS)

hideDiscountProductno
boolean

Optional. Filter out single product discounts

hideChainPromotions
boolean

Optional. Filter out chain promotions

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 1,
  • "hasMore": true
}

Add new promotion

Create a new promotion that results in an automatic discount when matching products are put in the POS cart.

The automatic assignment of discounts is based product filters (explained in more detail below). When these filters match, the promotion triggers an action resulting in some kind of discount presentend in the cart. Currently, actions come in two flavors: single product discounts and bundle discounts. How the promotion will trigger depends on this flavor.

Single product discounts (percentage, adjustPriceBy, percentageByCostprice, totalPriceUnit): Here, a single product gets discount by some amount. The filters can match against productnos, brands and tags.

Each promotion has a required name which shown in the cart when the discount is given. description is optional and designed only for humans to read. It is only shown in the settings. active can be used to disable promotions until they are ready. Promotions will also only be considered active when today's date is inside the startdate-enddate-range. If enddate is null, the promotion is considered to run forever.

Product filters are inclusive by nature. In the future, excluding filters will be added as well. Filters have an attribute and a value. The attribute can be various attributes of a product, like tag and productno. For instance, to give a discount on all bikes with tag Bike, see the example below). The value can be a list of values in which case, if either of the values match, the filter matches. And if either of the filters matches, the promotion will trigger (in case of single product discounts).

The filters for bundle discounts currently needs to be very specific: A single filter with attribute = productno and value = list of productnos.

In the future, it will be possible to filter based on customer attributes as well, such that specific customers can get certain discounts.

Request Body schema: application/json
object (Promotion)

Object representing a promotion.

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "id": 123
}

Retrieve promotion

Given a specific promotion id, fetch the entire promotion object.

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "id": 123,
  • "name": "Summer discount",
  • "description": "10% on all bikes in the summer.",
  • "deleted": 1,
  • "startdate": "2019-01-01 12:00:00",
  • "enddate": "2019-02-01 12:00:00",
  • "minproducts": 1,
  • "applyall": true,
  • "productfilters": [
    ],
  • "customerfilters": [
    ],
  • "loyalty_members_only": true,
  • "serviceplanfilters": [
    ],
  • "articles": null,
  • "storeid": 0,
  • "productno_counts": [
    ],
  • "count": 0,
  • "action": {
    }
}

Update promotion

Replace the promotion object of a specific promotion with another.

path Parameters
id
required
integer
Request Body schema: application/json
object (Promotion)

Object representing a promotion.

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "updated": 1
}

Delete promotion.

Delete a promotion based an id.

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "deleted": 1
}

Get all relevant promotions for a set of products and a customer.

Get all relevant promotions for a set of products and a customer. Currently the customer is ignore and can be null. This query can be seen as "given a cart, what promotions will match?"

If you have multiple of the same products in the query, they should be represented as a CartArticle, i.e. specified by a productno and quantity (see example). Otherwise, you can simply use productno strings.

Request Body schema: application/json
Array of strings or CartArticle (object)

List of productnos.

allowDeleted
boolean or null

Whether or not the lookup should find promotions which are deleted.

customer
integer or null

The id of the customer. Can be null, if returned promotions should be relevant for all customers.

Responses

Request samples

Content type
application/json
{
  • "products": [
    ],
  • "allowDeleted": true,
  • "customer": 42
}

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Given a cart, return the new cart with promotion discounts applied.

This endpoint is primarily used in our own POS implementation assumes our own cart data structure.

The bare minimum data structure for this call is an object with a property articles which is a list of CartArticle. Each article contains extra information about whether it is a product, discount etc. and whether it was created manually or automatically.

In the future, this might be made more generally applicable.

Responses

Given a ticket, apply promotions to materials based on materials and customer and return the list of materials.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 5,
  • "hasMore": true
}

RecurringPayment - Experimental

Get a recurring payment by id

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a list of recurring payments

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100
paginationPageLength
integer <= 200
Default: 20
Example: paginationPageLength=20
exceededduedate
integer

If exceededduedate is 1, it wil get all recurring payments, where the nextduedate is exceeded, and the customer still needs to pay.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Creates a recurring payment

Request Body schema: application/json
object (RecurringPayment)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Creates a new term payment and issues an invoice to economic. It degrades costprice and subtracts from amountleft.

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Cancels given recurring payment and regulates stock for the product and costprice

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Creates a recurring payment in draft mode and attaches an article to the given payment, which is -amountleft

path Parameters
paymentId
required
integer >= 0

payment id

Request Body schema: application/json
object (RecurringPayment)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Return products that are in the recurring payment, regulates stock for the product and costprice

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

ServicePlan

addServicePlan

query Parameters
productid
integer

If it is set, it will exclude all serviceplans that does not match with the producttagrestriction. If not set it will get all serviceplans.

withdeleted
boolean
Default: false

Wheter or not to include soft deleted service plans

Request Body schema: application/json
object (ServicePlan)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

ServicePlan

query Parameters
productid
integer

If it is set, it will exclude all serviceplans that does not match with the producttagrestriction. If not set it will get all serviceplans.

withdeleted
boolean
Default: false

Wheter or not to include soft deleted service plans

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

/serviceplan/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (ServicePlan)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

deleteServicePlan

path Parameters
id
required
integer

Responses

ServiceSubscription

addServiceSubscription

Request Body schema: application/json
object (ServiceSubscription)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

ServiceSubscription

query Parameters
customerarticleid
integer

Sort by customerarticleid

allowdeleted
integer

Allow deleted subscription with search (1 for allow deleted, if it is set to 0 or not set at all, it will not include deleted subscriptions)

serviceplanid
integer

Sort by serviceplanid

serieno
string

Sort by serieno

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

/servicesubscription/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (ServiceSubscription)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

deleteServiceSubscription

path Parameters
id
required
integer

Responses

addServiceSubscriptionToMaterial

By posting a serviceplanid, the serviceplan for the customerarticle attached to the material will be updated with the given serviceplanid, and a new material will be added to the task: The price of the serviceplan with its title. When this material is paid, the subscription for the customerarticle will be activated

path Parameters
materialid
required
integer
Request Body schema: application/json
object (ServiceSubscription)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Settings

Update a list of configs

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "targetStoreId": 0
}

Get all configs

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "targetStoreId": 0
}

Delete a config

path Parameters
configKey
required
string

Responses

Get settings

Responses

Response samples

Content type
application/json
{
  • "store": {
    },
  • "storeTimezone": "string",
  • "configs": [
    ],
  • "printDesk": {
    },
  • "appConfigs": {
    },
  • "customFields": [
    ],
  • "featureFlags": [
    ],
  • "partners": {
    },
  • "shouldShowWebshopCheckbox": true
}

Update store info

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "title": "string",
  • "cityname": "string",
  • "zipcode": "string",
  • "streetname": "string",
  • "streetno": "string",
  • "phone": "string",
  • "email": "string",
  • "created": "string",
  • "countrydata": {
    }
}

Get store info

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "title": "string",
  • "cityname": "string",
  • "zipcode": "string",
  • "streetname": "string",
  • "streetno": "string",
  • "phone": "string",
  • "email": "string",
  • "created": "string",
  • "countrydata": {
    }
}

ShoppingLists

Add items by barcode

Request Body schema: application/json
partnerstoreid
number
Array of objects

Responses

Request samples

Content type
application/json
{
  • "partnerstoreid": 0,
  • "barcodes": [
    ]
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Add item to the shopping list

Request Body schema: application/json
partnerstoreid
number

The store id of the store that item is moved to. Stock movements are recieved as shopping list orders. The store id must be on the store's stock partner list.

object (ShoppingListItem)

The representation of a shopping list item. The shopping list is a set of products the store must rememeber to order from a supplier.

aggregate
boolean or null
Default: true

Aggregate same products with same cost price into one list-item.

Responses

Request samples

Content type
application/json
{
  • "partnerstoreid": 0,
  • "content": {
    },
  • "aggregate": true
}

Response samples

Content type
application/json
{
  • "partnerstoreid": 0,
  • "content": {
    },
  • "aggregate": true
}

List shopping list

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of items) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of items to fetch in one page.

orderid
integer
Example: orderid=30
notordered
integer
Default: 0
Enum: 0 1

filter ordered items

supplierid
integer or null

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Get the total cost price of a shopping list

query Parameters
orderid
integer
Example: orderid=30
supplierid
integer or null

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a shopping list item

path Parameters
id
required
integer

The shopping list ID

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a item

path Parameters
id
required
integer

The shopping list ID

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Replace item in shopping list

path Parameters
id
required
integer

The shopping list ID

Request Body schema: application/json
partnerstoreid
number

The store id of the store that item is moved to. Stock movements are recieved as shopping list orders. The store id must be on the store's stock partner list.

object (ShoppingListItem)

The representation of a shopping list item. The shopping list is a set of products the store must rememeber to order from a supplier.

aggregate
boolean or null
Default: true

Aggregate same products with same cost price into one list-item.

Responses

Request samples

Content type
application/json
{
  • "partnerstoreid": 0,
  • "content": {
    },
  • "aggregate": true
}

Response samples

Content type
application/json
{
  • "partnerstoreid": 0,
  • "content": {
    },
  • "aggregate": true
}

ShoppingListOrders

Delete a shopping list order

Responses

Response samples

Content type
application/json
{
  • "deleted": 0
}

An order of shopping list items

Request Body schema: application/json
partnerstoreid
number

see movestocktostoreid in SetShoppingListItem

required
object (ShoppingListOrder)

The representation of a shopping list order item. An order is at set of shopping list items that have been ordered

Responses

Request samples

Content type
application/json
{
  • "partnerstoreid": 0,
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "partnerstoreid": 0,
  • "content": {
    }
}

List shopping list orders

query Parameters
paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of items) to fetch. This is usually a multiple of the pageLength.

freetext
string
Example: freetext=Bike

Freetext search for note, orderlist number, product title etc.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of items to fetch in one page.

received
integer
Example: received=1

If it is set to 1, it only retrieves orders with all items received

notReceived
integer
Example: notReceived=1

If it is set to 1, it only retrieves orders where the items are not received

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Update the shopping list order's note

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object

Content body for updating the note

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Delete a shopping list order

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "deleted": 0
}

Update the shopping list order

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object

Content body for updating the note

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Updates properties for all orders that has the given orderlistid.

path Parameters
orderlistid
required
integer
Request Body schema: application/json
expecteddelivery
string or null^\d{4}-\d{2}-\d{2}[T ]?\d{2}:\d{2}:\d{2}

Responses

Request samples

Content type
application/json
{
  • "expecteddelivery": "string"
}

Response samples

Content type
application/json
{
  • "updated": 0
}

StockTransactions

Search for stock transaction

Represents changes to product stock and costprice

query Parameters
productid
integer

The ID of the product

stocktransactionlistid
integer

The ID of the stock transaction list

paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of items) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=50

Determine the number of items to fetch in one page.

sort
string
Default: "id"
sortOrder
integer
Default: -1

-1 being descending and 1 being ascending.

committed_after
string
Example: committed_after=2020-01-01 00:00:00

Get all stocktransactions committed after the given date

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Change stock of a product relatively

Request Body schema: application/json
partnerstoreid
integer
Default: null

Save transaction at partner store

object (StockTransaction)

Apply relative stock change to a product. If you want to apply a absolute change to a product stock. Set the value using PUT /product/{id} on stockno.

Responses

Request samples

Content type
application/json
Example

Increase stock

{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a stock transaction

path Parameters
stocktransactionId
required
integer

The product ID

query Parameters
partnerstoreid
integer
Default: 0
Example: partnerstoreid=100

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Replace a stock transaction

Stock transactions can be changed if they are not committed

path Parameters
stocktransactionId
required
integer

The product ID

Request Body schema: application/json
partnerstoreid
integer
Default: null

Save transaction at partner store

object (StockTransaction)

Apply relative stock change to a product. If you want to apply a absolute change to a product stock. Set the value using PUT /product/{id} on stockno.

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a stock transaction

path Parameters
stocktransactionId
required
integer

The product ID

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

StockTransactionLists

List stock transaction lists

query Parameters
filter
string
Deprecated

Deprecated! . Filter expression. See https://restdocs.e-conomic.com/#filtering. In and Not In are not supported.

freetext
string
partnerstoreid
integer
Default: 0
Example: partnerstoreid=100
paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of items) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=30

Determine the number of items to fetch in one page.

includefromstore
integer or null

1 to include the store that sent the stock transaction, if present. 0 will not include the sender store.

committed
integer
Example: committed=1

1 to list committed lists, 0 to list non-committed lists

committedAfter
string

Query stock transaction lists committed after a given date.

type
string (StockTransactionListType)
Enum: "reception" "count" "move"
Example: type=move

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 5,
  • "hasMore": true
}

Add stock transaction list

Request Body schema: application/json
partnerstoreid
integer or null
Default: null

Save transaction at partner store

object (StockTransactionList)

A list of stock transactions. Set commit = 1 to commit all transactions in a list.

Responses

Request samples

Content type
application/json
{
  • "partnerstoreid": null,
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "totalcostprice": 0,
  • "addtostocksum": 0,
  • "errors": [
    ]
}

Get a stock transaction list

A list of stock transactions. All stock transaction can commited

path Parameters
stocktransactionlistId
required
integer

The ID

query Parameters
calculations
boolean

Display addToStockSum and totalCostprice in response by setting this value

Responses

Response samples

Content type
application/json
{
  • "content": {
    },
  • "totalcostprice": 0,
  • "addtostocksum": 0,
  • "errors": [
    ]
}

Replace a stock transaction list

path Parameters
stocktransactionlistId
required
integer

The ID

Request Body schema: application/json
partnerstoreid
integer or null
Default: null

Save transaction at partner store

object (StockTransactionList)

A list of stock transactions. Set commit = 1 to commit all transactions in a list.

Responses

Request samples

Content type
application/json
{
  • "partnerstoreid": null,
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "totalcostprice": 0,
  • "addtostocksum": 0,
  • "errors": [
    ]
}

Delete a Stock transaction list

path Parameters
stocktransactionlistId
required
integer

The ID

Responses

Bulk commit entries in a stock transaction list

path Parameters
id
required
integer

The ID

Request Body schema: application/json
One of
mode
required
string
Value: "create_list"
paginationStart
required
number
paginationLength
required
number

Responses

Request samples

Content type
application/json
Example
{
  • "mode": "create_list",
  • "paginationStart": 0,
  • "paginationLength": 0
}

Response samples

Content type
application/json
{
  • "failed": {
    },
  • "succeeded": {
    },
  • "failedListId": 0
}

Add stock transaction list from orderlistid

path Parameters
orderlistid
required
integer

The ID

Request Body schema: application/json
note
string or null

Note to the transactionlist

partnerstoreid
integer or null

If specified, stock transaction request will be sent to partner store

Responses

Request samples

Content type
application/json
{
  • "note": "string",
  • "partnerstoreid": 0
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "totalcostprice": 0,
  • "addtostocksum": 0,
  • "errors": [
    ]
}

Get invalid products

path Parameters
orderlistid
required
integer

The ID

query Parameters
partnerstoreid
required
integer
selectedorders
Array of numbers

Responses

Response samples

Content type
application/json
{
  • "hasInvalidOrders": true,
  • "content": [
    ]
}

StockTransactionTags

Add a transaction tag

Request Body schema: application/json
object (StockTransactionTag)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get all transaction tags

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Edit a transaction tag

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object (StockTransactionTag)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a transaction tag

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Suppliers

Adding a new supplier

Request Body schema: application/json

Ok

object (Supplier)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a list of all the suppliers.

query Parameters
hasOrders
integer
Default: 0

1 to include only suppliers that has orders

filter
string

Search string

paginationStart
number
Default: 0

Start of pagination

paginationPageLength
number
Default: 1000

Pagination page length

allowDeleted
boolean
Default: false
Example: allowDeleted=true

Include deleted suppliers in search

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 0,
  • "hasMore": true
}

Edit an exisiting supplier

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object (Supplier)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a supplier based on id

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a supplier based on id

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

TicketComments

Get list of ticket comments

query Parameters
filter
string
Deprecated

Deprecated! Use the taskid parameter instead. Filter expression. See https://restdocs.e-conomic.com/#filtering. In and Not In are not supported.

taskid
integer

Filter by task id

excludeautocomment
Array of strings

Array of autocomment values to exclude

includenullautocomments
boolean

Whether or not to include comment if autocomment is null, task comments have a autocomment of null by default

paginationStart
number
Default: 0

Start of pagination

paginationPageLength
number <= 250
Default: 250

Pagination page length

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 5,
  • "hasMore": true
}

Create a ticket comment

Request Body schema: application/json
object (TicketComment)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a ticket comment

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a ticket comment

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Update a ticket comment

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object (TicketComment)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

TicketFiles

Get a list of ticket files

query Parameters
filter
string
Deprecated

Deprecated! Use the taskid parameter instead. Filter expression. See https://restdocs.e-conomic.com/#filtering. In and Not In are not supported.

taskid
integer

Filter by task id

id
integer

Filter by id

paginationStart
number
Default: 0

Start of pagination

paginationPageLength
number <= 250
Default: 250

Pagination page length

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 5,
  • "hasMore": true
}

Add a new ticket file

Request Body schema: application/json
object (TicketFile)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a ticket file

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a ticket file

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

TicketMaterials

Get list of ticket materials

query Parameters
ticketid
integer

An ID of the ticket the material is associated with.

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 5,
  • "hasMore": true
}

Create a new ticket material

Request Body schema: application/json
object (TicketMaterial)
positionaftermaterialid
number or null

If this is set, the position of this material will be between positionaftermaterialid and the material below if (if it exists)

positionbeforematerialid
number or null

If this is set, the position of this material will be between positionbeforematerialid and the material above if (if it exists)

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "positionaftermaterialid": 0,
  • "positionbeforematerialid": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get a ticket material

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Delete a ticket material

path Parameters
id
required
integer >= 0

Id to the relevant resource

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Update a ticket material

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
object (TicketMaterial)
positionaftermaterialid
number or null

If this is set, the position of this material will be between positionaftermaterialid and the material below if (if it exists)

positionbeforematerialid
number or null

If this is set, the position of this material will be between positionbeforematerialid and the material above if (if it exists)

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "positionaftermaterialid": 0,
  • "positionbeforematerialid": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

TicketTags

addTicketTag

Request Body schema: application/json
object (TicketTag)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get all configs

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

/tickettags/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (TicketTag)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get all configs

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

Tickets

Get a list of tickets

query Parameters
filter
string
Deprecated

Filter expression. See https://restdocs.e-conomic.com/#filtering. In and Not In are not supported.

sortOrder
integer
Default: 1
Enum: -1 1
Example: sortOrder=1

Sorting order. If order is 1, items are retrieved in ascending order, if -1, in descending order.

sortField
string
Example: sortField=id

Sort by field.

paginationStart
integer
Default: 0
Example: paginationStart=100

Determine the offset (in number of items) to fetch. This is usually a multiple of the pageLength.

paginationPageLength
integer
Default: 50
Example: paginationPageLength=50

Determine the number of items to fetch in one page.

withPartnerStores
boolean
Default: false

Get partner store tickets

tagids
Array of strings <= 100 items

List of tag ids to restrict the search to.

ids
Array of strings <= 100 items

List of ids to restrict the search to.

excludetagids
Array of strings <= 100 items

List of tag ids that should not be in the task.

updated_after
string
Example: updated_after=2020-01-01 00:00:00

Get all tasks updated after the given date

startDate
string or null
Example: startDate=2020-01-01 00:00:00

Get tasks where pickup (and startTime if set) is after the given date

endDate
string or null
Example: endDate=2020-01-01 00:00:00

Get tasks where pickup (and startTime if set) is before the given date

customerid
integer or null

Id of customer assigned to the ticket

customerarticleid
integer or null

Id of customer article assigned to the ticket

cardno
string or null

Card number of the ticket

allowDeleted
boolean

Allow deleted tickets in response

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 5,
  • "hasMore": true
}

Create a new ticket

Request Body schema: application/json
object (Ticket)

A ticket representing a repair or work task.

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "storeid": 0,
  • "content": {
    }
}

Get a ticket

path Parameters
id
required
integer

The ticket ID

Responses

Response samples

Content type
application/json
{
  • "storeid": 0,
  • "content": {
    }
}

Update a ticket

path Parameters
id
required
integer

The ticket ID

Request Body schema: application/json
object (Ticket)

A ticket representing a repair or work task.

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "storeid": 0,
  • "content": {
    }
}

Delete a ticket

path Parameters
id
required
integer

The ticket ID

Responses

Response samples

Content type
application/json
{
  • "storeid": 0,
  • "content": {
    }
}

Duplicate a ticket from a ticketid (sets it as draft mode)

path Parameters
ticketId
required
integer >= 0

Responses

Response samples

Content type
application/json
{
  • "storeid": 0,
  • "content": {
    }
}

Add task materials to ticket from barcodes

path Parameters
ticketId
required
integer >= 0
Request Body schema: application/json
barcodes
Array of strings

Responses

Request samples

Content type
application/json
{
  • "barcodes": [
    ]
}

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "count": 5,
  • "hasMore": true
}

ServiceNotifications

Create servicenotices for specified customerarticles based on what would be selected by default when creating servicenotices via UI. Returns success status for each customerarticle

Request Body schema: application/json
content
Array of numbers

Array of customer article ids

protect
boolean
Default: true

only allow to add servicenotices to customer articles that have no servicenotices beforehand

useoriginaldate
boolean
Default: false

Use the latest selling date from each customer article as the origin date instead of using the date of today. Only servicenotifications that are on dates after today are generated

Responses

Request samples

Content type
application/json
{
  • "content": [
    ],
  • "protect": true,
  • "useoriginaldate": false
}

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Delete servicenotices for specified customerarticles based on what would be selected by default when deleting servicenotices via UI. Returns success status for each customerarticle

Request Body schema: application/json
content
Array of numbers

Array of customer article ids

Responses

Request samples

Content type
application/json
{
  • "content": [
    ]
}

Response samples

Content type
application/json
{
  • "content": [
    ]
}

TicketTemplate

/ticket-templates

Request Body schema: application/json
object (TicketTemplate)
positionAfterId
number or null

If this is set, the position of this TicketTemplate will be between positionaftermaterialid and the TicketTemplate below if (if it exists)

positionBeforeId
number or null

If this is set, the position of this TicketTemplate will be between positionbeforematerialid and the TicketTemplate above if (if it exists)

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "positionAfterId": 0,
  • "positionBeforeId": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get all templates

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

/ticket-templates/{id}

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templates/{id}

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templates/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (TicketTemplate)
positionAfterId
number or null

If this is set, the position of this TicketTemplate will be between positionaftermaterialid and the TicketTemplate below if (if it exists)

positionBeforeId
number or null

If this is set, the position of this TicketTemplate will be between positionbeforematerialid and the TicketTemplate above if (if it exists)

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "positionAfterId": 0,
  • "positionBeforeId": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templategroups

Request Body schema: application/json
object (TicketTemplateGroup)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get all configs

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

/ticket-templategroups/{id}

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templategroups/{id}

path Parameters
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templategroups/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (TicketTemplateGroup)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templates/{ticketTemplateId}/materials

path Parameters
ticketTemplateId
required
integer >= 0
Request Body schema: application/json
object (TicketTemplateMaterial)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Get all configs

path Parameters
ticketTemplateId
required
integer >= 0

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

/ticket-templates/{ticketTemplateId}/materials/{id}

path Parameters
ticketTemplateId
required
integer >= 0
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templates/{ticketTemplateId}/materials/{id}

path Parameters
ticketTemplateId
required
integer >= 0
id
required
integer

Responses

Response samples

Content type
application/json
{
  • "content": {
    }
}

/ticket-templates/{ticketTemplateId}/materials/{id}

path Parameters
ticketTemplateId
required
integer >= 0
id
required
integer
Request Body schema: application/json
object (TicketTemplateMaterial)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

TicketTemplateRelation

/ticket/{ticketId}/templates

path Parameters
ticketId
required
integer >= 0
Request Body schema: application/json
object (TicketTemplateRelation)
positionAfterId
number or null

If this is set, the position of this TicketTemplateRelation will be between positionaftermaterialid and the TicketTemplateRelation below if (if it exists)

positionBeforeId
number or null

If this is set, the position of this TicketTemplateRelation will be between positionbeforematerialid and the TicketTemplateRelation above if (if it exists)

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "positionAfterId": 0,
  • "positionBeforeId": 0
}

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "materialsChanged": true
}

Get all templates

path Parameters
ticketId
required
integer >= 0

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "materialsChanged": true
}

/ticket/{ticketId}/templates/{ticketTemplateId}

path Parameters
ticketId
required
integer >= 0
ticketTemplateId
required
integer >= 0

Responses

Response samples

Content type
application/json
{
  • "content": [
    ],
  • "materialsChanged": true
}

/ticket/{ticketId}/templates/{ticketTemplateId}

path Parameters
ticketId
required
integer >= 0
ticketTemplateId
required
integer >= 0
Request Body schema: application/json
object (TicketTemplateRelation)
positionAfterId
number or null

If this is set, the position of this TicketTemplateRelation will be between positionaftermaterialid and the TicketTemplateRelation below if (if it exists)

positionBeforeId
number or null

If this is set, the position of this TicketTemplateRelation will be between positionbeforematerialid and the TicketTemplateRelation above if (if it exists)

Responses

Request samples

Content type
application/json
{
  • "content": {
    },
  • "positionAfterId": 0,
  • "positionBeforeId": 0
}

Response samples

Content type
application/json
{
  • "content": {
    }
}

Users

Add user

Request Body schema: application/json
object (User)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "apitoken": "string"
}

get all users

query Parameters
withTrashed
boolean
Default: true
Example: withTrashed=true

return soft deleted users

Responses

Response samples

Content type
application/json
{
  • "content": [
    ]
}

Set user passcode

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
passcode
string or null

Responses

Request samples

Content type
application/json
{
  • "passcode": "string"
}

Set user password

path Parameters
id
required
integer >= 0

Id to the relevant resource

Request Body schema: application/json
password
string or null
currentPassword
string or null
email
string or null

Responses

Request samples

Content type
application/json
{
  • "password": "string",
  • "currentPassword": "string",
  • "email": "string"
}

/users/{id}

path Parameters
id
required
integer
Request Body schema: application/json
object (User)

Responses

Request samples

Content type
application/json
{
  • "content": {
    }
}

Response samples

Content type
application/json
{
  • "content": {
    },
  • "apitoken": "string"
}

/users/{id}

path Parameters
id
required
integer

Responses