Skip to content

Get

/products

Target audience: Developers

Introduction

Returns a list of products for an organisation

URI

Environment URI
Stage https://payway-api.stage.adeprimo.se/external/api/v1/products
Production https://backend.worldoftulo.com/external/api/v1/products

Required scope

1
/external/product/r

Parameters

Name Type Description
id String Id of a product. Cannot be used together with product_code.
Size range: ..24 Allowed values: "/^[a-f\d]{24}$/i"
product_code String The product code for a package/campaign. Cannot be used together with id.
Size range: 1..50 Allowed values: "/^[a-zA-Z-_0-9]+$/"
product_type String Retrieve product of a certain type
Allowed values: packages, campaigns, products
title_code String Retrieve only products for a specific title.
Size range: 1..15 Allowed values: "/^[a-zA-Z-_0-9]+$/"
tags String Retrieve only product for specific tags (case sensitive).
Size range: 1..100 Allowed values: "/^([a-zA-Z0-9]+,?\s*)+$/"
include_inactive Boolean Includes inactive products it true

Curl Example

Get by id

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products?id=52a781d6400e06897c00000f \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Get by product_code

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products?product_code=adeprimo_digital \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Specific type

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products?product_type=campaigns \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Specific title-code

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products?title_code=ADEPRIMO \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Specific title

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products?product_type=campaigns&title_code=ADEPRIMO \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Get by tags

1
2
3
4
curl --request GET \
  --url https://payway-api.stage.adeprimo.se/external/api/v1/products?tags=analog,digital \
  --header 'accept: application/json' \
  --header 'authorization: Bearer token' \

Response

Successful response for products without complex price model

1
HTTP 200
 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
{
  "items": [
    {
      "id": "56e1741a6fc9365306000002",
      "created": "2013-12-10T22:04:22+01:00",
      "updated": "2013-12-11T22:04:22+01:00",
      "product_code": "adeprimo_digital",
      "valid_from": "2013-12-10T22:04:22+01:00",
      "valid_to": "2014-01-10T22:04:22+01:00",
      "is_package": true,
      "is_campaign": false,
      "title_code": "ADEPRIMO",
      "name": "Adeprimo digital",
      "description": "Adeprimo digital provides you with digital content",
      "vat_code": "25",
      "customer_can_cancel": false,
      "products": [
        {
          "id": "580e10842762a843cf000005",
          "product_code": "adeprimo_webb",
          "name": "Adeprimo the website",
          "description": "The complete Adeprimo website"
        },
        {
          "id": "50ee9325400e06f15f0001b1",
          "product_code": "adeprimo_epaper",
          "name": "Adeprimo the website as Emagin epaper",
          "description": "The complete Adeprimo website as Emagin epaper"
        }
      ],
      "price_periods": [
        {
          "id": "5cb804811d41c82b5c518ea8",
          "purchase_type": "recurring",
          "payment_option": "creditcard",
          "type": "month",
          "length": 1,
          "price": 33.0
        },
        {
          "id": "5cb8055c1d41c831096033ad",
          "purchase_type": "limited",
          "payment_option": "creditcard",
          "type": "month",
          "length": 3,
          "price": 90.0
        }
      ],
      "tags": [
        {
          "name": "Analog",
          "type": "package"
        },
        {
          "name": "Digital",
          "type": "package"
        }
      ]
    }
  ]
}

Successful response for products with complex price model

1
HTTP 200
 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
{
  "items": [
    {
      "id": "56e1741a6fc9365306000002",
      "created": "2013-12-10T22:04:22+01:00",
      "updated": "2013-12-11T22:04:22+01:00",
      "product_code": "adeprimo_digital",
      "valid_from": "2013-12-10T22:04:22+01:00",
      "valid_to": "2014-01-10T22:04:22+01:00",
      "is_package": true,
      "is_campaign": false,
      "title_code": "ADEPRIMO",
      "name": "Adeprimo digital",
      "customer_can_cancel": true,
      "description": "Adeprimo digital provides you with digital content",
      "products": [
        {
          "id": "580e10842762a843cf000005",
          "product_code": "adeprimo_webb",
          "name": "Adeprimo the website",
          "description": "The complete Adeprimo website"
        },
        {
          "id": "50ee9325400e06f15f0001b1",
          "product_code": "adeprimo_epaper",
          "name": "Adeprimo the website as Emagin e-paper",
          "description": "The complete Adeprimo website as Emagin e-paper"
        }
      ],
      "price_periods": [
        {
          "id": "5cb8055c1d41c831096033ad",
          "purchase_type": "recurring",
          "payment_option": "creditcard",
          "type": "month",
          "length": 1,
          "details": [
            {
              "name": "Paper",
              "price": 40.0
              "vat_code": 6
            },
            {
              "name": "Digital",
              "price": 10.0
              "vat_code": 25
            },
          ]
        }
      ],
      "tags": [
        {
          "name": "Analog",
          "type": "package"
        },
        {
          "name": "Digital",
          "type": "package"
        }
      ]
    }
  ]
}

Errors

Example error response

1
HTTP 400 Bad Request
1
2
3
4
5
{
    "code": "invalid_parameter",
    "field": "account_id",
    "message": "Parameter must match format (/^[a-f\d]{24}$/)"
}

HTTP 400 Bad Request

Name Type Description
invalid_parameter Object Validation error on any of the fields in the posted json
unknown_parameter Object One or more of the fields in the posted json was not recognized

HTTP 404 Not Found

Name Type Description
not_found Object The product could not be found

HTTP 500 Internal Server Error

Name Type Description
internal_server_error Object Something unexpected happened server side