This page was automatically generated from tracezilla’s Swagger API documentation 2026-01-26

GET /contracts/{scope}

Get list of Contracts

Description

Returns list of Contracts

Parameters (path)

Name Required Description Values
scope required Scope. Can be either purchase or sales purchase, sales

Parameters (query)

Name Required Description Values
sortBy optional Field to sort by. Without sort specified it will sort first by ref and then name. ref, delivered_from, delivered_to, target, type, created_at, updated_at
sortDirection optional Direction of sort. asc, desc
keyword[ct] optional Search for contracts by keyword. Allowed expression(s): ct  
partner[eq] optional Search for contracts by partner. Allowed expression(s): eq  
ref[eq] optional Search for contracts by reference code. Allowed expression(s): eq  
created_at[gt] optional Search for contracts by created date. Allowed expression(s): gt, lt, lte, gte  
updated_at[gt] optional Search for contracts by updated date. Allowed expression(s): gt, lt, lte, gte  
include optional The resources that can be included in this request, delimited by a comma: sku, sku_tag, order_tag, partner, deliver_to_partner, deliver_to_location, comment, progress  

Responses

200

successful operation

Response content JSON schema
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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
{
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "required": [
          "ref",
          "remark",
          "partner_id",
          "target",
          "type"
        ],
        "properties": {
          "id": {
            "description": "Id of the record",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "currency": {
            "description": "ISO 4217 Currency Codes 3 letter currency code",
            "type": "string",
            "format": "string",
            "example": "DKK"
          },
          "delivered_from": {
            "description": "Orders delivered from that date will be covered by the contract",
            "type": "string",
            "format": "date",
            "example": "2019-01-01"
          },
          "delivered_to": {
            "description": "Orders delivered to that date will be covered by the framework agreement",
            "type": "string",
            "format": "date",
            "example": "2019-01-01"
          },
          "deliver_to_partner_id": {
            "description": "Only include orders delivered to partners with this ID. If null, all orders will be included.",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "deliver_to_location_id": {
            "description": "Only include orders delivered to partners with this location ID. If null, all orders will be included.",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "delivery_term_incoterm": {
            "description": "Incoterm to put on the order, when the order is created directly from this contract.",
            "type": "string",
            "format": "string",
            "enum": [
              "Ex Works",
              "FCA",
              "FAS",
              "FOB",
              "CFR",
              "CIF",
              "CPT",
              "CIP",
              "DAT",
              "DAP",
              "DDP"
            ],
            "example": "FOB"
          },
          "delivery_term_text": {
            "description": "A standalone delivery term text or a text to displayed with the selected incoterm",
            "type": "string",
            "format": "string",
            "example": "Hamburg"
          },
          "exchange_rate": {
            "description": "Exchange rate when the currency on the contract is different from the local currency",
            "type": "number",
            "format": "double",
            "example": 1234.123
          },
          "order_tag_id": {
            "description": "Limit this contract to only cover orders with this order tag. If null, all orders will be covered.",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "partner_id": {
            "description": "Reference to the partner model of the customer or supplier",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "quota": {
            "description": "If this contract is a quota and thereby the target should be considered a limit",
            "type": "boolean",
            "format": "boolean",
            "example": true
          },
          "ref": {
            "description": "A reference code for this contract",
            "type": "string",
            "format": "string",
            "example": "A string"
          },
          "remark": {
            "description": "A remark for the contract",
            "type": "string",
            "format": "string",
            "example": "A string"
          },
          "scope": {
            "description": "If this contract covers *purchase*- or *sales*-orders",
            "type": "string",
            "format": "string",
            "enum": [
              "sales",
              "purchase"
            ],
            "example": "sales"
          },
          "sku_id": {
            "description": "No description is available",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "sku_tag_id": {
            "description": "No description is available",
            "type": "string",
            "format": "uuid",
            "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
          },
          "target": {
            "description": "See *type* for further explanation",
            "type": "number",
            "format": "double",
            "example": 1234.123
          },
          "progress_share": {
            "description": "The total progess share of the *target*. *progress* needs to be included in the *include*-parameter",
            "type": "number",
            "format": "double",
            "readOnly": true,
            "example": 1234.123
          },
          "progress_total": {
            "description": "The total progress. *progress* needs to be included in the *include*-parameter",
            "type": "number",
            "format": "double",
            "readOnly": true,
            "example": 1234.123
          },
          "type": {
            "description": "How to measure target achievement. \n- *sku*: target will be a the quantity og UoMs of the sku specified in *sku_id*\n- *sku_tag*: target will be the total net weight of skus with the tag given in *sku_tag_id*\n- *revenue*: target will be the total revenue regardless of sku",
            "type": "string",
            "format": "string",
            "enum": [
              "sku",
              "sku_tag",
              "revenue"
            ],
            "example": "sku"
          },
          "tag_ids": {
            "description": "Tag ids related to the Order entity. \nNotice that these will only be included if *tags* are included in the include parameter",
            "type": "array",
            "items": {
              "format": "uuid",
              "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
            }
          },
          "archived_at": {
            "description": "The time when the record was marked as archived in UTC date & time (Iso8601 ZuluString)",
            "type": "string",
            "format": "date-time",
            "example": "2019-01-01T13:25:32.312Z"
          },
          "created_at": {
            "description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
            "type": "string",
            "format": "date-time",
            "example": "2019-01-01T13:25:32.312Z"
          },
          "updated_at": {
            "description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
            "type": "string",
            "format": "date-time",
            "example": "2020-01-01T13:25:32.312Z"
          }
        },
        "type": "object"
      }
    },
    "links": {
      "description": "Links",
      "properties": {
        "first": {
          "description": "Link to the first page",
          "type": "string"
        },
        "last": {
          "description": "Link to the last page",
          "type": "string"
        },
        "next": {
          "description": "Link to the next page",
          "type": "string"
        },
        "prev": {
          "description": "Link to the previous page",
          "type": "string"
        }
      },
      "type": "object"
    },
    "meta": {
      "description": "Meta with pagination",
      "properties": {
        "current_page": {
          "description": "The current page",
          "type": "integer"
        },
        "from": {
          "description": "The starting position of the current page results",
          "type": "integer"
        },
        "last_page": {
          "description": "The last page",
          "type": "integer"
        },
        "path": {
          "description": "The current path of the request",
          "type": "string"
        },
        "per_page": {
          "description": "Records that are displayed pr request",
          "type": "integer"
        },
        "to": {
          "description": "The ending position of the current page results",
          "type": "integer"
        },
        "total": {
          "description": "Number of records that are matched by the current query",
          "type": "integer"
        }
      },
      "type": "object"
    }
  },
  "type": "object"
}

406

not acceptable

500

internal server error

POST /contracts/{scope}

Create new Contract

Description

Create a new Contract

Parameters (path)

Name Required Description Values
scope required Scope. Can be either purchase or sales purchase, sales

Request body

Description

Target Contract.

Required

This parameter is required.

Request body JSON schema
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
{
  "required": [
    "ref",
    "remark",
    "partner_id",
    "target",
    "type"
  ],
  "properties": {
    "id": {
      "description": "Id of the record",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "currency": {
      "description": "ISO 4217 Currency Codes 3 letter currency code",
      "type": "string",
      "format": "string",
      "example": "DKK"
    },
    "delivered_from": {
      "description": "Orders delivered from that date will be covered by the contract",
      "type": "string",
      "format": "date",
      "example": "2019-01-01"
    },
    "delivered_to": {
      "description": "Orders delivered to that date will be covered by the framework agreement",
      "type": "string",
      "format": "date",
      "example": "2019-01-01"
    },
    "deliver_to_partner_id": {
      "description": "Only include orders delivered to partners with this ID. If null, all orders will be included.",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "deliver_to_location_id": {
      "description": "Only include orders delivered to partners with this location ID. If null, all orders will be included.",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "delivery_term_incoterm": {
      "description": "Incoterm to put on the order, when the order is created directly from this contract.",
      "type": "string",
      "format": "string",
      "enum": [
        "Ex Works",
        "FCA",
        "FAS",
        "FOB",
        "CFR",
        "CIF",
        "CPT",
        "CIP",
        "DAT",
        "DAP",
        "DDP"
      ],
      "example": "FOB"
    },
    "delivery_term_text": {
      "description": "A standalone delivery term text or a text to displayed with the selected incoterm",
      "type": "string",
      "format": "string",
      "example": "Hamburg"
    },
    "exchange_rate": {
      "description": "Exchange rate when the currency on the contract is different from the local currency",
      "type": "number",
      "format": "double",
      "example": 1234.123
    },
    "order_tag_id": {
      "description": "Limit this contract to only cover orders with this order tag. If null, all orders will be covered.",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "partner_id": {
      "description": "Reference to the partner model of the customer or supplier",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "quota": {
      "description": "If this contract is a quota and thereby the target should be considered a limit",
      "type": "boolean",
      "format": "boolean",
      "example": true
    },
    "ref": {
      "description": "A reference code for this contract",
      "type": "string",
      "format": "string",
      "example": "A string"
    },
    "remark": {
      "description": "A remark for the contract",
      "type": "string",
      "format": "string",
      "example": "A string"
    },
    "scope": {
      "description": "If this contract covers *purchase*- or *sales*-orders",
      "type": "string",
      "format": "string",
      "enum": [
        "sales",
        "purchase"
      ],
      "example": "sales"
    },
    "sku_id": {
      "description": "No description is available",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "sku_tag_id": {
      "description": "No description is available",
      "type": "string",
      "format": "uuid",
      "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
    },
    "target": {
      "description": "See *type* for further explanation",
      "type": "number",
      "format": "double",
      "example": 1234.123
    },
    "progress_share": {
      "description": "The total progess share of the *target*. *progress* needs to be included in the *include*-parameter",
      "type": "number",
      "format": "double",
      "readOnly": true,
      "example": 1234.123
    },
    "progress_total": {
      "description": "The total progress. *progress* needs to be included in the *include*-parameter",
      "type": "number",
      "format": "double",
      "readOnly": true,
      "example": 1234.123
    },
    "type": {
      "description": "How to measure target achievement. \n- *sku*: target will be a the quantity og UoMs of the sku specified in *sku_id*\n- *sku_tag*: target will be the total net weight of skus with the tag given in *sku_tag_id*\n- *revenue*: target will be the total revenue regardless of sku",
      "type": "string",
      "format": "string",
      "enum": [
        "sku",
        "sku_tag",
        "revenue"
      ],
      "example": "sku"
    },
    "tag_ids": {
      "description": "Tag ids related to the Order entity. \nNotice that these will only be included if *tags* are included in the include parameter",
      "type": "array",
      "items": {
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      }
    },
    "archived_at": {
      "description": "The time when the record was marked as archived in UTC date & time (Iso8601 ZuluString)",
      "type": "string",
      "format": "date-time",
      "example": "2019-01-01T13:25:32.312Z"
    },
    "created_at": {
      "description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
      "type": "string",
      "format": "date-time",
      "example": "2019-01-01T13:25:32.312Z"
    },
    "updated_at": {
      "description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
      "type": "string",
      "format": "date-time",
      "example": "2020-01-01T13:25:32.312Z"
    }
  },
  "type": "object"
}

Responses

200

successful operation

Response content JSON schema
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
189
190
191
{
  "properties": {
    "required": [
      "ref",
      "remark",
      "partner_id",
      "target",
      "type"
    ],
    "properties": {
      "id": {
        "description": "Id of the record",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "currency": {
        "description": "ISO 4217 Currency Codes 3 letter currency code",
        "type": "string",
        "format": "string",
        "example": "DKK"
      },
      "delivered_from": {
        "description": "Orders delivered from that date will be covered by the contract",
        "type": "string",
        "format": "date",
        "example": "2019-01-01"
      },
      "delivered_to": {
        "description": "Orders delivered to that date will be covered by the framework agreement",
        "type": "string",
        "format": "date",
        "example": "2019-01-01"
      },
      "deliver_to_partner_id": {
        "description": "Only include orders delivered to partners with this ID. If null, all orders will be included.",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "deliver_to_location_id": {
        "description": "Only include orders delivered to partners with this location ID. If null, all orders will be included.",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "delivery_term_incoterm": {
        "description": "Incoterm to put on the order, when the order is created directly from this contract.",
        "type": "string",
        "format": "string",
        "enum": [
          "Ex Works",
          "FCA",
          "FAS",
          "FOB",
          "CFR",
          "CIF",
          "CPT",
          "CIP",
          "DAT",
          "DAP",
          "DDP"
        ],
        "example": "FOB"
      },
      "delivery_term_text": {
        "description": "A standalone delivery term text or a text to displayed with the selected incoterm",
        "type": "string",
        "format": "string",
        "example": "Hamburg"
      },
      "exchange_rate": {
        "description": "Exchange rate when the currency on the contract is different from the local currency",
        "type": "number",
        "format": "double",
        "example": 1234.123
      },
      "order_tag_id": {
        "description": "Limit this contract to only cover orders with this order tag. If null, all orders will be covered.",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "partner_id": {
        "description": "Reference to the partner model of the customer or supplier",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "quota": {
        "description": "If this contract is a quota and thereby the target should be considered a limit",
        "type": "boolean",
        "format": "boolean",
        "example": true
      },
      "ref": {
        "description": "A reference code for this contract",
        "type": "string",
        "format": "string",
        "example": "A string"
      },
      "remark": {
        "description": "A remark for the contract",
        "type": "string",
        "format": "string",
        "example": "A string"
      },
      "scope": {
        "description": "If this contract covers *purchase*- or *sales*-orders",
        "type": "string",
        "format": "string",
        "enum": [
          "sales",
          "purchase"
        ],
        "example": "sales"
      },
      "sku_id": {
        "description": "No description is available",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "sku_tag_id": {
        "description": "No description is available",
        "type": "string",
        "format": "uuid",
        "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
      },
      "target": {
        "description": "See *type* for further explanation",
        "type": "number",
        "format": "double",
        "example": 1234.123
      },
      "progress_share": {
        "description": "The total progess share of the *target*. *progress* needs to be included in the *include*-parameter",
        "type": "number",
        "format": "double",
        "readOnly": true,
        "example": 1234.123
      },
      "progress_total": {
        "description": "The total progress. *progress* needs to be included in the *include*-parameter",
        "type": "number",
        "format": "double",
        "readOnly": true,
        "example": 1234.123
      },
      "type": {
        "description": "How to measure target achievement. \n- *sku*: target will be a the quantity og UoMs of the sku specified in *sku_id*\n- *sku_tag*: target will be the total net weight of skus with the tag given in *sku_tag_id*\n- *revenue*: target will be the total revenue regardless of sku",
        "type": "string",
        "format": "string",
        "enum": [
          "sku",
          "sku_tag",
          "revenue"
        ],
        "example": "sku"
      },
      "tag_ids": {
        "description": "Tag ids related to the Order entity. \nNotice that these will only be included if *tags* are included in the include parameter",
        "type": "array",
        "items": {
          "format": "uuid",
          "example": "be3233c4-c0a2-4f47-a62a-303492c20ba6"
        }
      },
      "archived_at": {
        "description": "The time when the record was marked as archived in UTC date & time (Iso8601 ZuluString)",
        "type": "string",
        "format": "date-time",
        "example": "2019-01-01T13:25:32.312Z"
      },
      "created_at": {
        "description": "The time when the record was created in UTC date & time (Iso8601 ZuluString)",
        "type": "string",
        "format": "date-time",
        "example": "2019-01-01T13:25:32.312Z"
      },
      "updated_at": {
        "description": "The time when the record was last updated in UTC date & time (Iso8601 ZuluString)",
        "type": "string",
        "format": "date-time",
        "example": "2020-01-01T13:25:32.312Z"
      }
    },
    "type": "object"
  },
  "type": "object"
}

406

not acceptable

500

internal server error