sk_api_schema 0.10.5 → 0.10.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +6 -1
  3. data/README.rdoc +1 -1
  4. data/json/v1.0/account.json +2 -2
  5. data/json/v1.0/contact.json +2 -2
  6. data/json/v1.0/line_item.json +3 -3
  7. data/json/v1.0/product.json +2 -2
  8. data/json/v1.0/sub.json +3 -3
  9. data/json/v2.0/account.json +172 -0
  10. data/json/v2.0/account_billing.json +131 -0
  11. data/json/v2.0/account_entry.json +212 -0
  12. data/json/v2.0/address.json +85 -0
  13. data/json/v2.0/attachment.json +133 -0
  14. data/json/v2.0/auth_permission.json +75 -0
  15. data/json/v2.0/client.json +318 -0
  16. data/json/v2.0/comment.json +122 -0
  17. data/json/v2.0/company.json +141 -0
  18. data/json/v2.0/contact.json +418 -0
  19. data/json/v2.0/credit_note.json +380 -0
  20. data/json/v2.0/divider_item.json +47 -0
  21. data/json/v2.0/document.json +240 -0
  22. data/json/v2.0/email.json +191 -0
  23. data/json/v2.0/email_template.json +132 -0
  24. data/json/v2.0/estimate.json +408 -0
  25. data/json/v2.0/export.json +142 -0
  26. data/json/v2.0/export_template.json +100 -0
  27. data/json/v2.0/invoice.json +407 -0
  28. data/json/v2.0/language.json +82 -0
  29. data/json/v2.0/line_item.json +121 -0
  30. data/json/v2.0/order.json +373 -0
  31. data/json/v2.0/payment.json +148 -0
  32. data/json/v2.0/payment_reminder.json +301 -0
  33. data/json/v2.0/pdf_template.json +99 -0
  34. data/json/v2.0/product.json +144 -0
  35. data/json/v2.0/recurring.json +340 -0
  36. data/json/v2.0/sub.json +60 -0
  37. data/json/v2.0/sub_total_item.json +57 -0
  38. data/json/v2.0/tag.json +76 -0
  39. data/json/v2.0/task.json +229 -0
  40. data/json/v2.0/text_template.json +95 -0
  41. data/json/v2.0/user.json +103 -0
  42. data/lib/sk_api_schema/version.rb +1 -1
  43. metadata +35 -2
@@ -0,0 +1,380 @@
1
+ { "type":"object",
2
+ "title": "credit_note",
3
+ "name": "credit_note",
4
+ "description": "A credit note",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "number":{
15
+ "description": "Unique number assigned by SK credit note number schema. Auto-assigned when document is opened. Required unless doc status is draft.",
16
+ "type":"string",
17
+ "maxLength": 50
18
+ },
19
+ "address_field":{
20
+ "description": "Address field with the receiver. Shown in envelope window.",
21
+ "type":"string"
22
+ },
23
+ "date":{
24
+ "description": "Date the credit note is issued. Automatically set when document is opened. Required unless doc status is draft. YYYY-MM-DD",
25
+ "format":"date",
26
+ "type":"string"
27
+ },
28
+ "due_days":{
29
+ "description": "Used to calculate the due date of the credit note. Useless if date and due date are present.",
30
+ "type":"integer"
31
+ },
32
+ "due_date":{
33
+ "description": "Auto-calculated from date + due days if empty and the document is opened. YYYY-MM-DD",
34
+ "format":"date",
35
+ "type":"string"
36
+ },
37
+ "status":{
38
+ "description": "Defaults to draft for new documents, unless otherwise stated. For new documents with status 'open' or 'closed' or doc where the status changes away from draft, following fields are set if empty: number(next in number schema), date(today), due date(due_days must be given). Only draft documents can be deleted.",
39
+ "default":"draft",
40
+ "enum":["draft","open","closed"],
41
+ "type":"string"
42
+ },
43
+ "external_ref":{
44
+ "description": "Some external reference, whatever this may be.",
45
+ "type":"string",
46
+ "maxLength": 255
47
+ },
48
+ "payment_method":{
49
+ "description": "How the document is being payed. Used for new payments.",
50
+ "enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"],
51
+ "type":"string"
52
+ },
53
+ "title":{
54
+ "description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your credit note [number]'",
55
+ "type":"string",
56
+ "maxLength": 255
57
+ },
58
+ "notes_before":{
59
+ "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
60
+ "type":"string",
61
+ "format":"text"
62
+ },
63
+ "notes_after":{
64
+ "description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.",
65
+ "type":"string",
66
+ "format":"text"
67
+ },
68
+ "tag_list":{
69
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
70
+ "type":"string"
71
+ },
72
+ "language":{
73
+ "description": "Should be a valid language short-code: de-DE, fr, en-GB; like defined in your account language menu. When the document is emailed or printed, a localized version of a multi-language template(email, pdf) will be used if available. Defaults to the clients language, if empty and a client is assigned.",
74
+ "type":"string",
75
+ "maxLength": 10
76
+ },
77
+ "currency":{
78
+ "description": "Currency code as defined by the ISO 4217 standard (3-letter UPCASE: EUR, USD)",
79
+ "type":"string",
80
+ "maxLength": 3,
81
+ "minLength": 3
82
+ },
83
+ "exchange_rate":{
84
+ "description": "The exchange rate from the foreign document currency(eg. USD) to the company currency(EUR). If the rate is empty we use the exchange rate on the document date or today if doc.date is empty. If there is no rate for this day, say on weekends, the closest previous day is taken(Sunday->Friday). If you open the doc at a later time make sure to manually refresh the rate, as we dont change it. ",
85
+ "readonly":true,
86
+ "type":"number"
87
+ },
88
+ "gross_total_exchanged":{
89
+ "description": "Exchanged gross total, in your company currency.",
90
+ "readonly":true,
91
+ "type":"number"
92
+ },
93
+ "archived_pdf":{
94
+ "description": "Archived PDF version of the document. Is created when an document is printed and archived. A document can have multiple archived versions. This only returns the most recent one. ",
95
+ "readonly":true,
96
+ "type":"object",
97
+ "properties":{"$ref":"./attachment.json#properties"}
98
+ },
99
+ "client":{
100
+ "description": "DEPRECATED: use contact",
101
+ "readonly":true,
102
+ "type":"object",
103
+ "properties":{"$ref":"./client.json#properties"}
104
+ },
105
+ "client_id":{
106
+ "description": "DEPRECATED: use contact_id",
107
+ "type":"string",
108
+ "maxLength": 22,
109
+ "minLength":22
110
+ },
111
+ "contact":{
112
+ "description": "The contact for the document. Use contact_id field to set a contact.",
113
+ "readonly":true,
114
+ "type":"object",
115
+ "properties":{"$ref":"./contact.json#properties"}
116
+ },
117
+ "contact_id":{
118
+ "description": "The contact uuid. When assigning a contact its language, currency, address_field (due days, cash discount) values are used for the document if those doc-fields are not set.",
119
+ "type":"string",
120
+ "maxLength": 22,
121
+ "minLength":22
122
+ },
123
+ "team_id":{
124
+ "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.",
125
+ "readonly" :true,
126
+ "type":"string",
127
+ "maxLength": 22,
128
+ "minLength":22
129
+ },
130
+ "line_items":{
131
+ "description": "DEPRECATED use items",
132
+ "type":"array",
133
+ "properties":{"$ref":"./line_item.json#properties"}
134
+ },
135
+ "items":{
136
+ "description": "Items for the document. Access items of all types including divider and sub_total items. GOTCHAs when using items instead of line_items: You MUST set the type field(CamelCasesItem class name) on each item. You cannot use both, the line_items array is stronger for backward compat.",
137
+ "type":"array",
138
+ "default": "any",
139
+ "minItems": 0,
140
+ "items": [{ "$ref": "./line_item.json#properties"},
141
+ { "$ref": "./divider_item.json#properties"},
142
+ { "$ref": "./sub_total_item.json#properties"}]
143
+ },
144
+ "created_at":{
145
+ "description": "Date the object was created in SK. Never changes afterwards.",
146
+ "format":"date-time",
147
+ "readonly":true,
148
+ "type":"string"
149
+ },
150
+ "updated_at":{
151
+ "description": "Date the object was edited in SK.",
152
+ "format":"date-time",
153
+ "readonly":true,
154
+ "type":"string"
155
+ },
156
+ "lock_version":{
157
+ "description": "Auto-incremented to prevent concurrent updates. First save wins.",
158
+ "type":"integer"
159
+ },
160
+ "price_total":{
161
+ "description": "DEPRECATED: use net_total_base",
162
+ "readonly":true,
163
+ "type":"number"
164
+ },
165
+ "price_tax":{
166
+ "description": "DEPRECATED: use tax_total",
167
+ "readonly":true,
168
+ "type":"number"
169
+ },
170
+ "gross_total":{
171
+ "description": "Gross total of all line items, 2 decimals places in document currency.",
172
+ "readonly":true,
173
+ "type":"number"
174
+ },
175
+ "tax_total":{
176
+ "description": "Tax total, 2 decimals places",
177
+ "readonly":true,
178
+ "type":"number"
179
+ },
180
+ "net_total":{
181
+ "description": "Net total, 2 decimals places",
182
+ "readonly":true,
183
+ "type":"number"
184
+ },
185
+ "net_total_base":{
186
+ "description": "Net total, 6 decimal places incl. discount",
187
+ "readonly":true,
188
+ "type":"number"
189
+ },
190
+ "cost_total":{
191
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
192
+ "readonly":true,
193
+ "type":"number"
194
+ },
195
+ "gross_margin_total":{
196
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
197
+ "readonly":true,
198
+ "type":"number"
199
+ },
200
+ "gross_margin_pct":{
201
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
202
+ "readonly":true,
203
+ "type":"number"
204
+ }
205
+ },
206
+ "links":[
207
+ { "rel": "self",
208
+ "href": "credit_notes/{id}"
209
+ },
210
+ { "rel": "instances",
211
+ "href": "credit_notes",
212
+ "properties" : {
213
+ "page":{
214
+ "title" : "Page",
215
+ "description": "In paginated results set the page to look for",
216
+ "type":"number"
217
+ },
218
+ "per_page":{
219
+ "title" : "Per page",
220
+ "description": "Results per page. Default is 50, max is 200",
221
+ "type":"number"
222
+ },
223
+ "filter[q]":{
224
+ "title" : "Search",
225
+ "description": "Search in title, number, address field",
226
+ "type":"string"
227
+ },
228
+ "filter[status]":{
229
+ "title" : "Status",
230
+ "description": "A single or a list of status, comma separated: open,closed,overdue,draft",
231
+ "type" : "string"
232
+ },
233
+ "filter[number]":{
234
+ "title" : "Number",
235
+ "description": "Find by exact number",
236
+ "type":"string"
237
+ },
238
+ "filter[tags]":{
239
+ "title" : "Tags",
240
+ "description": "Filter by a space delimited list of tags",
241
+ "type":"string"
242
+ },
243
+ "filter[from]":{
244
+ "title" : "From date",
245
+ "description": "Objects with a date on and after the date. YYYY-MM-DD",
246
+ "type" :"date"
247
+ },
248
+ "filter[to]":{
249
+ "title" : "To date",
250
+ "description": "Objects with date before and on the date. YYYY-MM-DD",
251
+ "type" :"date"
252
+ },
253
+ "filter[created_at_from]":{
254
+ "title" : "From date",
255
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
256
+ "format" : "date-time",
257
+ "type" : "string"
258
+ },
259
+ "filter[created_at_to]":{
260
+ "title" : "To date",
261
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
262
+ "format" : "date-time",
263
+ "type" : "string"
264
+ },
265
+ "filter[languages]":{
266
+ "title" : "Languages",
267
+ "description": "A list of language codes, comma separated",
268
+ "type" : "string"
269
+ },
270
+ "filter[client_ids]":{
271
+ "title" : "Clients",
272
+ "description": "A single or a list of client uuids, comma separated",
273
+ "type" : "string"
274
+ },
275
+ "filter[ids]":{
276
+ "title" : "Documents",
277
+ "description": "A single or a list of document uuids, comma separated",
278
+ "type" : "string"
279
+ },
280
+ "filter[creator_ids]":{
281
+ "title" : "Creator",
282
+ "description": "Objects created by the given users uuids, comma separated",
283
+ "type" : "string"
284
+ },
285
+ "filter[product_ids]":{
286
+ "title" : "Products",
287
+ "description": "Documents using the given product uuids(comma separated) in their line items.",
288
+ "type" : "string"
289
+ },
290
+ "sort_by":{
291
+ "title" : "Sort by",
292
+ "description": "Sort the results by the given field => number",
293
+ "enum":["title", "number", "created_at", "updated_at", "price_total", "price_tax", "date", "due_date"],
294
+ "type": "string"
295
+ },
296
+ "sort":{
297
+ "title" : "Sort",
298
+ "enum":["ASC","DESC"],
299
+ "description": "Sort the results in ASC or DESC",
300
+ "type": "string"
301
+ }
302
+ }
303
+ },
304
+ { "rel": "destroy",
305
+ "href": "credit_notes/{id}",
306
+ "method": "DELETE"
307
+ },
308
+ { "rel": "update",
309
+ "href": "credit_notes/{id}",
310
+ "method": "PUT"
311
+ },
312
+ { "rel": "create",
313
+ "href": "credit_notes",
314
+ "method": "POST",
315
+ "properties" : {
316
+ "source" : {
317
+ "title" : "Source document id",
318
+ "description": "Copies the source(excl. number,date) and returns a new draft document. You can pass any document type(e.g. invoice, order). Fields passed with the object(e.g. notes, title, address_field) are not overwritten."
319
+ },
320
+ "cancel" : {
321
+ "title" : "Cancel an credit note",
322
+ "description": "Cancelling a document negates its line item values. A source id must be set.",
323
+ "dependencies": ["source"]
324
+ }
325
+ }
326
+ },
327
+ { "rel": "attachments",
328
+ "href": "credit_notes/{id}/attachments"
329
+ },
330
+ { "rel": "payments",
331
+ "href": "credit_notes/{id}/payments"
332
+ },
333
+ { "rel": "comments",
334
+ "href": "credit_notes/{id}/comments"
335
+ },
336
+ { "rel": "emails",
337
+ "href": "credit_notes/{id}/emails"
338
+ },
339
+ { "rel": "emails create",
340
+ "href": "credit_notes/{id}/emails",
341
+ "method": "POST",
342
+ "properties" : {
343
+ "template_id":{
344
+ "title" : "Template",
345
+ "description": "UUID of an email template to use. If present template fields like subject, body, attachments are used for the current email.",
346
+ "type":"string",
347
+ "maxLength": 22,
348
+ "minLength":22
349
+ },
350
+ "send":{
351
+ "title" : "Send email",
352
+ "description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
353
+ },
354
+ "archived_pdf":{
355
+ "title" : "Attach archived pdf",
356
+ "description": "Adds the archived pdf from the related resource(if it has one)."
357
+ }
358
+ }
359
+ },
360
+ { "rel": "payment create",
361
+ "href": "invoices/{id}/payments",
362
+ "method": "POST"
363
+ },
364
+ { "rel": "print",
365
+ "href": "credit_notes/{id}/print",
366
+ "method": "POST",
367
+ "properties" : {
368
+ "template_id" : {
369
+ "title" : "PDF template used for printing",
370
+ "description": "UUID of a pdf template used to print the document. MUST be present",
371
+ "required":true
372
+ },
373
+ "base64" : {
374
+ "title" : "Return the created pdf base64 encoded",
375
+ "description": "If set the new pdf is returned inside the attachment JSON within 'base64' key. Leave empty to save traffic."
376
+ }
377
+ }
378
+ }
379
+ ]
380
+ }
@@ -0,0 +1,47 @@
1
+ { "type":"object",
2
+ "title": "divider_item",
3
+ "name": "divider_item",
4
+ "description": "A divider item serves as a separator or headline between line items, e.g. to distinguish hardware and service products on a document. Access and creation is done via documents.items(instead of line_items) where each item has a 'type' field set to its CamelCased class name.",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "position":{
15
+ "description": "Required since items are sorted by position.",
16
+ "type":"integer",
17
+ "required":true
18
+ },
19
+ "name":{
20
+ "description": "The divider text",
21
+ "type":"string",
22
+ "maxLength": 50
23
+ },
24
+ "type":{
25
+ "description": "The item type: DividerItem. Must be set when creating new items via document.items array",
26
+ "type":"string",
27
+ "maxLength": 20
28
+ },
29
+ "created_at":{
30
+ "description": "Date the object was created in SK. Never changes afterwards",
31
+ "format":"date-time",
32
+ "readonly":true,
33
+ "type":"string"
34
+ },
35
+ "updated_at":{
36
+ "description": "Date the object was edited in SK.",
37
+ "format":"date-time",
38
+ "readonly":true,
39
+ "type":"string"
40
+ },
41
+ "_destroy":{
42
+ "description": "When set an existing item will be deleted. This switch is used for items submitted nested within their parent object(a document), which is default as long as there is no line item endpoint available.",
43
+ "type":"boolean"
44
+ }
45
+ },
46
+ "links":[]
47
+ }
@@ -0,0 +1,240 @@
1
+ { "type":"object",
2
+ "title": "document",
3
+ "name": "document",
4
+ "description": "This resource is readonly and serves as a convenient way to query documents independent of their type(invoice, order,..). The specific document type is set in each object in the result-set. Internally Document is the base class for all types and special fields are defined in each child-class. Due to this some fields might be missing if you are using this meta-class in queries.",
5
+ "properties":{
6
+ "id":{
7
+ "description":"Unique identifier - UUID",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength": 22
13
+ },
14
+ "object_type":{
15
+ "description": "The specific type of the document singular CamelCased: Invoice, PaymentReminder",
16
+ "type":"string"
17
+ },
18
+ "number":{
19
+ "description": "Unique number assigned by a user or automatic by the object's number schema.",
20
+ "type":"string",
21
+ "maxLength": 50
22
+ },
23
+ "address_field":{
24
+ "description": "Receiver address, normally shown in envelope window. Defaults to client address_field.",
25
+ "type":"string"
26
+ },
27
+ "date":{
28
+ "description": "Date the document is issued. Automatically set when document is opened. Required for non-draft documents. YYYY-MM-DD",
29
+ "format":"date",
30
+ "type":"string"
31
+ },
32
+ "external_ref":{
33
+ "description": "Some external reference, whatever this may be.",
34
+ "type":"string",
35
+ "maxLength": 255
36
+ },
37
+ "title":{
38
+ "description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your invoice [number]'",
39
+ "type":"string",
40
+ "maxLength": 255
41
+ },
42
+ "notes_before":{
43
+ "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
44
+ "type":"string",
45
+ "format":"text"
46
+ },
47
+ "notes_after":{
48
+ "description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.",
49
+ "type":"string",
50
+ "format":"text"
51
+ },
52
+ "tag_list":{
53
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
54
+ "type":"string"
55
+ },
56
+ "client_id":{
57
+ "description": "DEPRECATED: use contact_id",
58
+ "type":"string",
59
+ "maxLength": 22,
60
+ "minLength":22
61
+ },
62
+ "contact_id":{
63
+ "description": "The contact uuid. When assigning a contact its language, currency, address_field (due days, cash discount) values are used for the document if those doc-fields are not set.",
64
+ "type":"string",
65
+ "maxLength": 22,
66
+ "minLength":22
67
+ },
68
+ "team_id":{
69
+ "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.",
70
+ "readonly" :true,
71
+ "type":"string",
72
+ "maxLength": 22,
73
+ "minLength":22
74
+ },
75
+ "line_items":{
76
+ "description": "Line items for the document",
77
+ "type":"array",
78
+ "items":{"$ref":"./line_items.json#properties"}
79
+ },
80
+ "items":{
81
+ "description": "Items for the document. Access items of all types including divider and sub_total items.",
82
+ "type":"array",
83
+ "default": "any",
84
+ "minItems": 0,
85
+ "items": [{ "$ref": "./line_item.json#properties"},
86
+ { "$ref": "./divider_item.json#properties"},
87
+ { "$ref": "./sub_total_item.json#properties"}]
88
+ },
89
+ "created_at":{
90
+ "description": "Date the object was created in SK. Never changes afterwards.",
91
+ "format":"date-time",
92
+ "readonly":true,
93
+ "type":"string"
94
+ },
95
+ "updated_at":{
96
+ "description": "Date the object was edited in SK.",
97
+ "format":"date-time",
98
+ "readonly":true,
99
+ "type":"string"
100
+ },
101
+ "gross_total":{
102
+ "description": "Gross total of all line items, 2 decimals places in document currency.",
103
+ "readonly":true,
104
+ "type":"number"
105
+ },
106
+ "tax_total":{
107
+ "description": "Tax total, 2 decimals places",
108
+ "readonly":true,
109
+ "type":"number"
110
+ },
111
+ "net_total":{
112
+ "description": "Net total, 2 decimals places",
113
+ "readonly":true,
114
+ "type":"number"
115
+ },
116
+ "net_total_base":{
117
+ "description": "Net total, 6 decimal places incl. discount",
118
+ "readonly":true,
119
+ "type":"number"
120
+ },
121
+ "currency":{
122
+ "description": "Currency code as defined by the ISO 4217 standard. 3-letter UPCASE: EUR, USD",
123
+ "type":"string",
124
+ "maxLength": 3,
125
+ "minLength": 3
126
+ },
127
+ "exchange_rate":{
128
+ "description": "The exchange rate from the foreign document currency(eg. USD) to the company currency(EUR). If the rate is empty we use the exchange rate on the document date or today if doc.date is empty. If there is no rate for this day, say on weekends, the closest previous day is taken(Sunday->Friday). If you open the doc at a later time make sure to manually refresh the rate, as we dont change it. ",
129
+ "readonly":true,
130
+ "type":"number"
131
+ },
132
+ "gross_total_exchanged":{
133
+ "description": "Exchanged gross total, in your company currency.",
134
+ "readonly":true,
135
+ "type":"number"
136
+ },
137
+ "language":{
138
+ "description": "Should be a valid language short-code: de-DE, fr, en-GB; like defined in your account language menu. When the document is emailed or printed, a localized version of a multi-language template(email, pdf) will be used if available. Defaults to the clients language, if empty and a client is assigned.",
139
+ "type":"string",
140
+ "maxLength": 10
141
+ }
142
+
143
+ },
144
+ "links":[
145
+ { "rel": "self",
146
+ "href": "documents/{id}"
147
+ },
148
+ { "rel": "instances",
149
+ "href": "documents",
150
+ "properties" : {
151
+ "page":{
152
+ "title" : "Page",
153
+ "description": "In paginated results set the page to look for",
154
+ "type":"number"
155
+ },
156
+ "per_page":{
157
+ "title" : "Per page",
158
+ "description": "Results per page. Default is 50, max is 200",
159
+ "type":"number"
160
+ },
161
+ "filter[q]":{
162
+ "title" : "Search",
163
+ "description": "Search in title, number, address field",
164
+ "type":"string"
165
+ },
166
+ "filter[number]":{
167
+ "title" : "Number",
168
+ "description": "Find by exact number",
169
+ "type":"string"
170
+ },
171
+ "filter[tags]":{
172
+ "title" : "Tags",
173
+ "description": "Filter by a space delimited list of tags",
174
+ "type":"string"
175
+ },
176
+ "filter[from]":{
177
+ "title" : "From date",
178
+ "description": "Objects with a date after the date. YYYY-MM-DD",
179
+ "format" : "date",
180
+ "type" : "string"
181
+ },
182
+ "filter[to]":{
183
+ "title" : "To date",
184
+ "description": "Objects with date before the date. YYYY-MM-DD",
185
+ "format" : "date",
186
+ "type" : "string"
187
+ },
188
+ "filter[created_at_from]":{
189
+ "title" : "From date",
190
+ "description": "Objects with a creation on/after the date(>=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the start of the day(00:00:00) so all objects created on this day are included. A time should be already utc time",
191
+ "format" : "date-time",
192
+ "type" : "string"
193
+ },
194
+ "filter[created_at_to]":{
195
+ "title" : "To date",
196
+ "description": "Objects with a creation until the date(<=). ISO 8601 format YYY-MM-DDThh:mm:ss+z or just a date YYY-MM-DD. If date is given the time is set to the end of the day(23:59:59) so all objects created on that day are included. A time should be already utc time.",
197
+ "format" : "date-time",
198
+ "type" : "string"
199
+ },
200
+ "filter[languages]":{
201
+ "title" : "Languages",
202
+ "description": "A list of language codes, comma separated",
203
+ "type" : "string"
204
+ },
205
+ "filter[client_ids]":{
206
+ "title" : "Clients",
207
+ "description": "DEPRECATED use contact_ids",
208
+ "type" : "string"
209
+ },
210
+ "filter[contact_ids]":{
211
+ "title" : "Contacts",
212
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
213
+ "type" : "string"
214
+ },
215
+ "filter[ids]":{
216
+ "title" : "Documents",
217
+ "description": "A single or a list of document uuids, comma separated",
218
+ "type" : "string"
219
+ },
220
+ "filter[creator_ids]":{
221
+ "title" : "Creator",
222
+ "description": "Objects created by the given users uuids, comma separated",
223
+ "type" : "string"
224
+ },
225
+ "sort_by":{
226
+ "title" : "Sort by",
227
+ "description": "Sort the results by the given field => number",
228
+ "enum":["title", "number", "created_at", "updated_at", "price_total", "price_tax", "date", "due_date"],
229
+ "type": "string"
230
+ },
231
+ "sort":{
232
+ "title" : "Sort",
233
+ "enum":["ASC","DESC"],
234
+ "description": "Sort the results in ASC or DESC",
235
+ "type": "string"
236
+ }
237
+ }
238
+ }
239
+ ]
240
+ }