# Getting Started

A product resembles the core element of the Tillhub ERP and POS Solution. Without products, you can not make a sale (except of LPS Features, that allow to neglect any validation). We support multiple types of products:

  • Standard products
  • Variant products
  • Linked products
  • Voucher products

In this example, we will create a standard product.

# Prerequisits

In order to create products, we need to have knowledge about our accounting schemes. The only mandatory fields on products are:

  • name
  • custom_id
  • tax
  • account
  • type

Where name, tax, account, and type are strictly validated, the custom_id is not. In order to be able to create a sale with a product on the POS, the custom_id is mandatory. The API will not reject the object if the custom_id is missing!

# name

The name of the product that is visible in the POS and ERP Applications. It will also be printed on the receipts. Usually the products trade name e.g.: Bamboo Toothbrush Soft

# custom_id

The custom_id resembles the product ID visible across the Tillhub Platforms and printed on the receipt of the register at the POS. It can be auto generated by the product number generator. This needs to be configured and a url parameter needs to be attached: https://api.tillhub.com/api/v1/products/{ client_account_id }?generate_product_id=true

# tax

The tax field receives a uuid of the corresponding tax object the product should receive. In Tillhub the POS Applications always expect the value added tax information to be present, otherwise it will not be possible to sell a product. Explicit over implicit! We do not 'assume' a tax class, but rather expect them to be present.

You can fetch them via:

curl -X GET \
  'https://staging-api.tillhub.com/api/v0/taxes/{ clientAccountID }?deleted=false' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'authorization: Your JW-Token' \
1
2
3
4

The example returns:

{
    "status": 200,
    "msg": "Queried all tax references successfully.",
    "request": {
        "host": "api.tillhub.com",
        "id": "af5c2e76-2edc-4acf-9f45-923639d5732e"
    },
    "count": 1,
    "results": [
        {
            "id": "1e3c83c5-7a2c-4cc4-a2e9-90957d5fd2d8",
            "name": "Tax 19%",
            "account": "b9de010a-c68c-4e30-bc7d-7bcb459e1ffc",
            "rate": 0.19,
            "is_fixed": false,
            "active": true,
            "percentage": 19,
            "created_at": {
                "iso": "2018-08-06T16:43:06.690Z",
                "unix": 1533573786690
            },
            "updated_at": {
                "iso": "2019-08-22T01:43:48.188Z",
                "unix": 1566438228188
            },
            "metadata": null,
            "type": "vat",
            "deleted": false,
            "fa_account_number": "1889",
            "accounts": null,
            "financial_accounts": null,
            "percentage_millis": 1900
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

In the results array, find the corresponding Tax Item and set the ID in product.tax.

# account

Analog to the tax item, a product needs to receive a revenue account. This is the basis for compliant bookkeeping across the world.

curl 'https://api.tillhub.com/api/v0/accounts/{ clientAccountID }?type=revenue&deleted=false' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'authorization: YourJW-Token' \
  --compressed
1
2
3
4

# Creating a product

# Example Request

POST Request towards /products/{ clientAccountID } containing a data body with the product object.

curl -X POST \
  'https://api.tillhub.com/api/v1/products/{ clientAccountID }' \
  -H 'accept: application/json, text/plain, */*' \
  -H 'authorization: YourJW-Token' \
  -H 'content-type: application/json;charset=UTF-8' \
  -d '{
    "active": true,
    "type": "product",
    "name": "Bamboo Toothbrush Soft1",
    "account": "UUIDofTheRevenueAccountObjectInTillhub",
    "tax": "UUIDofTheTAXAccountObjectInTillhub",
    "custom_id": "ProductNumber",
    "attributes": {},
    "codes": [],
    "barcode": null,
    "product_group": null,
    "categories": null,
    "images": {},
    "stock_minimum": null,
    "stockable": true,
    "sku": null,
    "description": null,
    "summary": null,
    "prices": {
        "default_prices": [
            {
                "amount": {
                    "net": 69,
                    "gross": 82.11
                },
                "purchase_price": 3,
                "currency": "EUR",
                "cost": 20,
                "margin": 2
            }
        ],
        "branch_prices": []
    },
    "default_tile_color": null,
    "external_reference_id": null,
    "discountable": true,
    "linkable": false,
    "linked_products": null,
    "brand": null,
    "manufacturer": {
        "iln": null
    },
    "supplier": {
        "sku": null
    },
    "locations": null,
    "stock_mode": "simple",
    "reorder_point": null,
    "reorder_qty": null,
    "tags": [],
    "is_service": false,
    "service_questions": null,
    "configuration": {
        "allow_zero_prices": true,
        "pricing": {
            "allow_is_free": false
        }
    },
    "online": null,
    "shipping_required": null
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66

# The body in detail

{
    "active": true,
    "type": "product",
    "name": "Bamboo Toothbrush Soft",
    "account": "UUIDofTheRevenueAccountObjectInTillhub",
    "tax": "UUIDofTheTAXAccountObjectInTillhub",
    "custom_id": "ProductNumber",
    "attributes": {},
    "codes": [],
    "barcode": null,
    "product_group": null,
    "categories": null,
    "images": {},
    "stock_minimum": null,
    "stockable": true,
    "sku": null,
    "description": null,
    "summary": null,
    "prices": {
        "default_prices": [
            {
                "amount": {
                    "net": 69,
                    "gross": 82.11
                },
                "purchase_price": 3,
                "currency": "EUR",
                "cost": 20,
                "margin": 2
            }
        ],
        "branch_prices": []
    },
    "default_tile_color": null,
    "external_reference_id": null,
    "discountable": true,
    "linkable": false,
    "linked_products": null,
    "brand": null,
    "manufacturer": {
        "iln": null
    },
    "supplier": {
        "sku": null
    },
    "locations": null,
    "stock_mode": "simple",
    "reorder_point": null,
    "reorder_qty": null,
    "tags": [],
    "is_service": false,
    "service_questions": null,
    "configuration": {
        "allow_zero_prices": true,
        "pricing": {
            "allow_is_free": false
        }
    },
    "online": null,
    "shipping_required": null
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

# Making a call

In order to make a call to the Backend, utilise the Bearer token returned by the authentication endpoints. E.g. in the products tutorials..