Attribute/values from a category

To know which attributes and values are available from a category, you can send a GET request to /api/products/{sku}/attributes.

This will return a response similar to:

 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
{
    "format": [
      "A4",
      "A5"
    ],
    "material": [
      "lasergeschikt bankpost wit",
      "lasergeschikt ECO",
      "lasergeschikt biotop natural FSC",
      "lasergeschikt vergé white",
      "lasergeschikt vergé naturel"
    ],
    "weight": [
      "80 grs",
      "120 grs"
    ],
    "printing colors": [
      "1/0 PMS",
      "4/0 full color",
      "3/3 PMS",
      "4/4 full color"
    ],
    "printing process": [
      "digital",
      "full color offset",
      "PMS colors"
    ],
    "quantity": [
      "25",
      "50",
      "250",
      "500",
      "1000",
      "5000",
      "10000",
      "15000",
      "100000",
      "variable quantity"
    ],
    "delivery time": [
      "normal",
      "express",
      "overnight"
    ],
    "letterheads punchholes": [
      "2 punchholes",
      "4 punchholes",
      "no punchhole"
    ],
    "bundling": [
      "no bundling",
      "bundling per 100",
      "bundling per 250"
    ]
  }

To order a specific product you can retrieve the possible combinations, and create an order.

Example request

The following PHP code can be used to retrieve the available attributes and values. Make sure you replace the values YOUR_USER_ID_HERE and YOUR_SECRET_HERE with the User-ID and secret you received on the API-credentials page.

 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
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.printdeal.com/api/products/0d1fce7e-245d-47fb-98bf-bea07f3ad16e/attributes",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "API-Secret: YOUR_SECRET_HERE",
    "User-ID: YOUR_USER_ID_HERE",
    "Accept: application/vnd.printdeal-api.v2"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}

Dynamic Attributes

We have improved the functionality for “dynamic attributes” (we call them “externals”). Dynamic attributes are free input fields, for example, height & width for a banner, or a variable quantity. It is now possible to get them through the API. Each category has a fixed “externals” key. This key is always present, even if a category does not have externals. In this case, the value will be an empty array.

We also added validation rules for some of the externals. Not all rules are exported however, unfortunately our validation engine is too complex to show all the rules in a meaningful and understandable way. But basic rules like the minimum and maximum value for the externals “width”, “height”, and “quantity” are now exported in most cases. If you find externals without rules, than that means that either there are no rules defined, or the rule is too complex to show in the API. In this case, use trial and error to find valid products.

Criteria can also be present on external rules. These are values that must be present in the selection for this rule to be active. Take the following example below. The rule “width_max” (maximum width) with value “310” is active when “Budget PVC” is selected. But when “Flag fabric” is selected, the value for “width_max” is 5000.

v2:

  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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
{
  "material": [
    "Pvc frontlit",
    "Mesh",
    "Blockout",
    "Flag Fabric",
    "Budget Pvc"
  ],
  "printing colors": [
    "4/0 Full Color",
    "4/4 Full Color"
  ],
  "banners finishing": [
    "Perimetric Reinforcement With Grommets Every 30 Cm",
    "Perimetric Reinforcement With Grommets Every 50 Cm",
    "No Finishing",
    "Pole Pockets Top And Bottom Side (8 Cm)",
    "Pole Pockets Top And Bottom Side (5 Cm)",
    "Pole Pockets Left And Right Side (8 Cm)",
    "Pole Pockets Left And Right Side (5 Cm)",
    "Perimetric Reinforcement With Grommets In Every Corner",
    "Grommets Every 30 Cm, Without Perimetric Reinforcement",
    "Pole Pockets Blockout Top And Bottom Side",
    "Pole Pockets Blockout Left And Right Side"
  ],
  "format": [
    "Custom Sizes (10 Mm Bleed)",
    "Custom Sizes (25 Mm Bleed)"
  ],
  "quantity": [
    "1",
    "variable quantity"
  ],
  "delivery time": [
    "Normal",
    "express",
    "overnight"
  ],
  "printing process": [
    "Digital"
  ],
  "externals": {
    "width": [
      {
        "validation": "width_min",
        "value": "10",
        "criteria": [
          "Pvc frontlit",
          "Blockout",
          "Mesh",
          "Flag Fabric"
        ]
      },
      {
        "validation": "width_max",
        "value": "5000",
        "criteria": [
          "Pvc frontlit",
          "Mesh"
        ]
      },
      {
        "validation": "width_max",
        "value": "5000",
        "criteria": [
          "Flag Fabric"
        ]
      },
      {
        "validation": "width_min",
        "value": "10",
        "criteria": [
          "Budget Pvc"
        ]
      },
      {
        "validation": "width_max",
        "value": "310",
        "criteria": [
          "Budget Pvc"
        ]
      },
      {
        "validation": "width_min",
        "value": "30",
        "criteria": [
          "Pole Pockets Left And Right Side (8 Cm)"
        ]
      },
      {
        "validation": "width_max",
        "value": "1200",
        "criteria": [
          "Blockout"
        ]
      }
    ],
    "quantity": [
      {
        "validation": "quantity_min",
        "value": "1",
        "criteria": [
          "Normal",
          "express",
          "overnight"
        ]
      },
      {
        "validation": "quantity_max",
        "value": "50",
        "criteria": [
          "Normal",
          "express"
        ]
      },
      {
        "validation": "quantity_max",
        "value": "25",
        "criteria": [
          "overnight"
        ]
      }
    ],
    "height": [
      {
        "validation": "height_min",
        "value": "10",
        "criteria": [
          "Pvc frontlit",
          "Blockout",
          "Mesh",
          "Flag Fabric"
        ]
      },
      {
        "validation": "height_max",
        "value": "5000",
        "criteria": [
          "Pvc frontlit",
          "Mesh"
        ]
      },
      {
        "validation": "height_max",
        "value": "1000",
        "criteria": [
          "Flag Fabric",
          "Budget Pvc"
        ]
      },
      {
        "validation": "height_max",
        "value": "5000",
        "criteria": [
          "Flag Fabric"
        ]
      },
      {
        "validation": "height_min",
        "value": "10",
        "criteria": [
          "Budget Pvc"
        ]
      },
      {
        "validation": "height_max",
        "value": "1000",
        "criteria": [
          "Budget Pvc"
        ]
      },
      {
        "validation": "height_min",
        "value": "30",
        "criteria": [
          "Pole Pockets Top And Bottom Side (8 Cm)"
        ]
      },
      {
        "validation": "height_max",
        "value": "315",
        "criteria": [
          "Blockout"
        ]
      }
    ]
  }
}

v1:

  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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{
    "material": [
        "Pvc frontlit",
        "Mesh",
        "Blockout",
        "Flag Fabric",
        "Budget Pvc"
    ],
    "printing colors": [
        "4\/0 Full Color",
        "4\/4 Full Color"
    ],
    "banners finishing": [
        "Perimetric Reinforcement With Grommets Every 30 Cm",
        "Perimetric Reinforcement With Grommets Every 50 Cm",
        "No Finishing",
        "Pole Pockets Top And Bottom Side (8 Cm)",
        "Pole Pockets Top And Bottom Side (5 Cm)",
        "Pole Pockets Left And Right Side (8 Cm)",
        "Pole Pockets Left And Right Side (5 Cm)",
        "Perimetric Reinforcement With Grommets In Every Corner",
        "Grommets Every 30 Cm, Without Perimetric Reinforcement",
        "Pole Pockets Blockout Top And Bottom Side",
        "Pole Pockets Blockout Left And Right Side"
    ],
    "format": [
        "Custom Sizes (10 Mm Bleed)",
        "Custom Sizes (25 Mm Bleed)"
    ],
    "quantity": [
        "1",
        "variable quantity"
    ],
    "delivery time": [
        "Normal",
        "express",
        "overnight"
    ],
    "printing process": [
        "Digital"
    ],
    "externals": {
        "width": [
            {
                "validation": "width_min",
                "value": "10",
                "criteria": [
                    "PVC frontlit (B-1 fire retardant)",
                    "blockout (B-1 fire retardant)",
                    "mesh (B-1 fire retardant)",
                    "Flag fabric"
                ]
            },
            {
                "validation": "width_max",
                "value": "5000",
                "criteria": [
                    "PVC frontlit (B-1 fire retardant)",
                    "blockout (B-1 fire retardant)",
                    "mesh (B-1 fire retardant)"
                ]
            },
            {
                "validation": "width_max",
                "value": "5000",
                "criteria": [
                    "Flag fabric"
                ]
            },
            {
                "validation": "width_min",
                "value": "10",
                "criteria": [
                    "Budget PVC"
                ]
            },
            {
                "validation": "width_max",
                "value": "310",
                "criteria": [
                    "Budget PVC"
                ]
            },
            {
                "validation": "width_min",
                "value": "30",
                "criteria": [
                    "vertical reinforcement left - right 8 cm"
                ]
            }
        ],
        "quantity": [
            {
                "validation": "quantity_min",
                "value": "1",
                "criteria": [
                    "normal",
                    "express",
                    "overnight"
                ]
            },
            {
                "validation": "quantity_max",
                "value": "50",
                "criteria": [
                    "normal",
                    "express"
                ]
            },
            {
                "validation": "quantity_max",
                "value": "25",
                "criteria": [
                    "overnight"
                ]
            }
        ],
        "height": [
            {
                "validation": "height_min",
                "value": "10",
                "criteria": [
                    "PVC frontlit (B-1 fire retardant)",
                    "blockout (B-1 fire retardant)",
                    "mesh (B-1 fire retardant)",
                    "Flag fabric"
                ]
            },
            {
                "validation": "height_max",
                "value": "5000",
                "criteria": [
                    "PVC frontlit (B-1 fire retardant)",
                    "blockout (B-1 fire retardant)",
                    "mesh (B-1 fire retardant)"
                ]
            },
            {
                "validation": "height_max",
                "value": "1000",
                "criteria": [
                    "Flag fabric",
                    "Budget PVC"
                ]
            },
            {
                "validation": "height_max",
                "value": "5000",
                "criteria": [
                    "Flag fabric"
                ]
            },
            {
                "validation": "height_min",
                "value": "10",
                "criteria": [
                    "Budget PVC"
                ]
            },
            {
                "validation": "height_max",
                "value": "1000",
                "criteria": [
                    "Budget PVC"
                ]
            },
            {
                "validation": "height_min",
                "value": "30",
                "criteria": [
                    "horizontal reinforcement top - bottom 8 cm"
                ]
            }
        ]
    }
}