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,191 @@
1
+ { "type":"object",
2
+ "title": "email",
3
+ "name": "email",
4
+ "description":"An email in SK must always be related to an object. Receivers are limited to 5 per address field.",
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
+ "bcc_addr":{
15
+ "description": "BCC addresses, comma separated. Max 5, format: a@b.de,'George'<georg@sk.eu>",
16
+ "type":"string",
17
+ "format":"text"
18
+ },
19
+ "cc_addr":{
20
+ "description": "CC addresses, comma separated. Max 5, format: a@b.de,'George'<georg@sk.eu>",
21
+ "type":"string",
22
+ "format":"text"
23
+ },
24
+ "from_addr":{
25
+ "description": "From address. If empty the email of the current user is taken.",
26
+ "type":"string",
27
+ "maxLength": 255
28
+ },
29
+ "to_addr":{
30
+ "description": "TO addresses, comma separated. Max 5, format: a@b.de,'George'<georg@sk.eu>",
31
+ "required":true,
32
+ "type":"string",
33
+ "format":"text"
34
+ },
35
+ "subject":{
36
+ "description": "The email subject.",
37
+ "required":true,
38
+ "type":"string",
39
+ "maxLength": 255
40
+ },
41
+ "body":{
42
+ "description": "The email text.",
43
+ "required":true,
44
+ "type":"string",
45
+ "format":"text"
46
+ },
47
+ "attachments":{
48
+ "description": "The emails attachments.",
49
+ "readonly":true,
50
+ "type":"array",
51
+ "properties":{"$ref":"./attachment.json#properties"}
52
+ },
53
+ "related_object_type":{
54
+ "description": "Object type of the emails parent. Is the camelcased base class name: Document for invoice, credit_note, contact,..",
55
+ "required":true,
56
+ "type":"string"
57
+ },
58
+ "related_object_id":{
59
+ "description": "uuid of the emails parent object.",
60
+ "required":true,
61
+ "type":"string",
62
+ "maxLength": 22,
63
+ "minLength":22
64
+ },
65
+ "in_progress":{
66
+ "description": "Is set after an email has been scheduled for sending until it has been sent.",
67
+ "readonly":true,
68
+ "type":"boolean"
69
+ },
70
+ "log":{
71
+ "description": "Logs error message when sending failed.",
72
+ "readonly":true,
73
+ "type":"text"
74
+ },
75
+ "delivered_at":{
76
+ "description": "Date the email was delivered by SK. If set, the message cannot be edited anymore.",
77
+ "format":"date-time",
78
+ "readonly":true,
79
+ "type":"string"
80
+ },
81
+ "created_at":{
82
+ "description": "Date the object was created in SK. Never changes afterwards",
83
+ "format":"date-time",
84
+ "readonly":true,
85
+ "type":"string"
86
+ },
87
+ "updated_at":{
88
+ "description": "Date the object was edited in SK.",
89
+ "format":"date-time",
90
+ "readonly":true,
91
+ "type":"string"
92
+ },
93
+ "team_id":{
94
+ "description": "A team uuid taken from the related object. If set only the team and its parent teams can see the record.",
95
+ "readonly" :true,
96
+ "type":"string",
97
+ "maxLength": 22,
98
+ "minLength":22
99
+ }
100
+ },
101
+ "links":[
102
+ { "rel": "self",
103
+ "href": "emails/{id}"
104
+ },
105
+ { "rel": "instances",
106
+ "href": "emails",
107
+ "properties" : {
108
+ "page":{
109
+ "title" : "Page",
110
+ "description": "In paginated results set the page to look for",
111
+ "type":"number"
112
+ },
113
+ "per_page":{
114
+ "title" : "Per page",
115
+ "description": "Results per page. Default is 50, max is 200",
116
+ "type":"number"
117
+ },
118
+ "filter[q]":{
119
+ "title" : "Search",
120
+ "description": "Search in body and subject",
121
+ "type":"string"
122
+ },
123
+ "filter[status]":{
124
+ "title" : "Emails by status",
125
+ "description": "Show only sent, draft or emails in progress. The status is virtual and checks the delivered_at and in_progress field values.",
126
+ "enum":["draft", "sent", "in_progress" ]
127
+ },
128
+ "filter[address]":{
129
+ "title" : "Search in address",
130
+ "description": "Searches in all address fields: bcc, cc, to, from"
131
+ },
132
+ "filter[from]":{
133
+ "title" : "From date",
134
+ "description": "All objects updated on/after the date. YYYY-MM-DD",
135
+ "format" : "date",
136
+ "type" : "string"
137
+ },
138
+ "filter[to]":{
139
+ "title" : "To date",
140
+ "description": "All objects updated on/before the date. YYYY-MM-DD",
141
+ "format" : "date",
142
+ "type" : "string"
143
+ },
144
+ "sort_by":{
145
+ "title" : "Sort by",
146
+ "description": "Sort the results by the given field",
147
+ "enum":["created_at", "updated_at"],
148
+ "type": "string"
149
+ },
150
+ "sort":{
151
+ "title" : "Sort",
152
+ "enum":["ASC","DESC"],
153
+ "description": "Sort the results in ASC or DESC",
154
+ "type": "string"
155
+ }
156
+ }
157
+ },
158
+ { "rel": "attachments",
159
+ "href": "emails/{id}/attachments"
160
+ },
161
+ { "rel": "destroy",
162
+ "href": "emails/{id}",
163
+ "method": "DELETE"
164
+ },
165
+ { "rel": "update",
166
+ "href": "emails/{id}",
167
+ "method": "PUT"
168
+ },
169
+ { "rel": "create",
170
+ "href": "emails",
171
+ "method": "POST",
172
+ "properties" : {
173
+ "template_id":{
174
+ "title" : "Template",
175
+ "description": "UUID of an email template to use. If present, subject, body and attachments of the template are used for the current email.",
176
+ "type":"string",
177
+ "maxLength": 22,
178
+ "minLength":22
179
+ },
180
+ "send":{
181
+ "title" : "Send email",
182
+ "description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
183
+ },
184
+ "archived_pdf":{
185
+ "title" : "Attach archived pdf",
186
+ "description": "Adds the archived pdf from the related resource(if it has one)."
187
+ }
188
+ }
189
+ }
190
+ ]
191
+ }
@@ -0,0 +1,132 @@
1
+ { "type":"object",
2
+ "title": "email_template",
3
+ "name": "email_template",
4
+ "description":"An email_template is used to simplify the creation of emails. When creating a new email just pass template id and all fields from the template are copied to the new email. The fields are NOT merged with present values in a new email object!",
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
+ "name":{
15
+ "description": "A meaningful name.",
16
+ "required":true,
17
+ "type":"string",
18
+ "maxLength": 50
19
+ },
20
+ "subject":{
21
+ "description": "Subject containing placeholders, replaced when the template is used.",
22
+ "required":true,
23
+ "type":"string",
24
+ "maxLength": 255
25
+ },
26
+ "body":{
27
+ "description": "Body with placeholders, replaced when the template is used.",
28
+ "required":true,
29
+ "type":"string",
30
+ "format":"text"
31
+ },
32
+ "from_addr":{
33
+ "description": "Default from address. A valid email address. Make sure your server(if custom SMPT settings for the API user) allows sending with this address.",
34
+ "type":"string",
35
+ "maxLength": 255
36
+ },
37
+ "cc_addr":{
38
+ "description": "Default copy receivers comma separated valid email addresses.",
39
+ "type":"string",
40
+ "maxLength": 255
41
+ },
42
+ "bcc_addr":{
43
+ "description": "Default blind copy receivers comma separated valid email addresses. ",
44
+ "type":"string",
45
+ "maxLength": 255
46
+ },
47
+ "kind":{
48
+ "description": "Kind of object the template can be used for.",
49
+ "required":true,
50
+ "enum": ["invoice", "estimate", "credit_note", "payment_reminder", "order", "contact"],
51
+ "type":"string"
52
+ },
53
+ "language":{
54
+ "description": "Should be a valid language short-code: de-DE, fr, en-GB; like defined in your account language menu. A multi-language template must belong to a parent. From then on just choose the parent-template and the localized child version is used if the related object(client, invoice,..) of the email, has the appropriate language.",
55
+ "type":"string",
56
+ "maxLength": 10
57
+ },
58
+ "created_at":{
59
+ "description": "Date the object was created in SK. Never changes afterwards",
60
+ "format":"date-time",
61
+ "readonly":true,
62
+ "type":"string"
63
+ },
64
+ "updated_at":{
65
+ "description": "Date the object was edited in SK.",
66
+ "format":"date-time",
67
+ "readonly":true,
68
+ "type":"string"
69
+ },
70
+ "team_id":{
71
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
72
+ "type":"string",
73
+ "maxLength": 22,
74
+ "minLength":22
75
+ }
76
+ },
77
+ "links":[
78
+ { "rel": "self",
79
+ "href": "email_templates/{id}"
80
+ },
81
+ { "rel": "instances",
82
+ "href": "email_templates",
83
+ "properties" : {
84
+ "page":{
85
+ "title" : "Page",
86
+ "description": "In paginated results set the page to look for",
87
+ "type":"number"
88
+ },
89
+ "per_page":{
90
+ "title" : "Per page",
91
+ "description": "Results per page. Default is 50, max is 200",
92
+ "type":"number"
93
+ },
94
+ "sort_by":{
95
+ "title" : "Sort by",
96
+ "description": "Sort the results by the given field",
97
+ "enum":["created_at", "updated_at"],
98
+ "type": "string"
99
+ },
100
+ "sort":{
101
+ "title" : "Sort",
102
+ "enum":["ASC","DESC"],
103
+ "description": "Sort the results in ASC or DESC",
104
+ "type":"string"
105
+ },
106
+ "filter[q]":{
107
+ "title" : "Search wildcard",
108
+ "description": "Searches in name, body, subject",
109
+ "type":"string"
110
+ },
111
+ "filter[kind]":{
112
+ "title" : "Search by kind",
113
+ "description": "Kind of object this template can be used for",
114
+ "enum": ["invoice", "estimate", "credit_note", "payment_reminder", "order", "contact"],
115
+ "type":"string"
116
+ }
117
+ }
118
+ },
119
+ { "rel": "destroy",
120
+ "href": "email_templates/{id}",
121
+ "method": "DELETE"
122
+ },
123
+ { "rel": "update",
124
+ "href": "email_templates/{id}",
125
+ "method": "PUT"
126
+ },
127
+ { "rel": "create",
128
+ "href": "email_templates",
129
+ "method": "POST"
130
+ }
131
+ ]
132
+ }
@@ -0,0 +1,408 @@
1
+ { "type":"object",
2
+ "title": "estimate",
3
+ "name": "estimate",
4
+ "description": "An estimate",
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 estimate number schema. Auto-assigned when estimate is opened. Required unless doc status is draft.",
16
+ "type":"string",
17
+ "maxLength": 50
18
+ },
19
+ "address_field":{
20
+ "description": "Receiver address, normally shown in envelope window. Defaults to client address_field if empty and client_id present.",
21
+ "type":"string"
22
+ },
23
+ "date":{
24
+ "description": "Date the estimate is issued. Automatically set when estimate is opened. Required for non-draft documents. YYYY-MM-DD",
25
+ "format":"date",
26
+ "type":"string"
27
+ },
28
+ "due_days":{
29
+ "description": "Used to calculate the valid-until date of the estimate. 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 estimate 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","rejected","billed" ],
41
+ "type":"string"
42
+ },
43
+ "external_ref":{
44
+ "description": "Some external reference, whatever this may be.",
45
+ "type":"string",
46
+ "maxLength": 255
47
+ },
48
+ "title":{
49
+ "description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your estimate [number]'",
50
+ "type":"string",
51
+ "maxLength": 255
52
+ },
53
+ "notes_before":{
54
+ "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
55
+ "type":"string",
56
+ "format":"text"
57
+ },
58
+ "notes_after":{
59
+ "description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.",
60
+ "type":"string",
61
+ "format":"text"
62
+ },
63
+ "tag_list":{
64
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
65
+ "type":"string"
66
+ },
67
+ "language":{
68
+ "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.",
69
+ "type":"string",
70
+ "maxLength": 10
71
+ },
72
+ "currency":{
73
+ "description": "Currency code as defined by the ISO 4217 standard (3-letter UPCASE: EUR, USD)",
74
+ "type":"string",
75
+ "maxLength": 3,
76
+ "minLength": 3
77
+ },
78
+ "exchange_rate":{
79
+ "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. ",
80
+ "readonly":true,
81
+ "type":"number"
82
+ },
83
+ "gross_total_exchanged":{
84
+ "description": "Exchanged gross total, in your company currency.",
85
+ "readonly":true,
86
+ "type":"number"
87
+ },
88
+ "archived_pdf":{
89
+ "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. ",
90
+ "readonly":true,
91
+ "type":"object",
92
+ "properties":{"$ref":"./attachment.json#properties"}
93
+ },
94
+ "client":{
95
+ "description": "DEPRECATED: use contact",
96
+ "readonly":true,
97
+ "type":"object",
98
+ "properties":{"$ref":"./client.json#properties"}
99
+ },
100
+ "client_id":{
101
+ "description": "DEPRECATED: use contact_id",
102
+ "type":"string",
103
+ "maxLength": 22,
104
+ "minLength":22
105
+ },
106
+ "contact":{
107
+ "description": "The contact for the document. Use contact_id field to set a contact.",
108
+ "readonly":true,
109
+ "type":"object",
110
+ "properties":{"$ref":"./contact.json#properties"}
111
+ },
112
+ "contact_id":{
113
+ "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.",
114
+ "type":"string",
115
+ "maxLength": 22,
116
+ "minLength":22
117
+ },
118
+ "team_id":{
119
+ "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.",
120
+ "readonly" :true,
121
+ "type":"string",
122
+ "maxLength": 22,
123
+ "minLength":22
124
+ },
125
+ "line_items":{
126
+ "description": "DEPRECATED use items",
127
+ "type":"array",
128
+ "properties":{"$ref":"./line_item.json#properties"}
129
+ },
130
+ "items":{
131
+ "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.",
132
+ "type":"array",
133
+ "default": "any",
134
+ "minItems": 0,
135
+ "items": [{ "$ref": "./line_item.json#properties"},
136
+ { "$ref": "./divider_item.json#properties"},
137
+ { "$ref": "./sub_total_item.json#properties"}]
138
+ },
139
+ "created_at":{
140
+ "description": "Date the object was created in SK. Never changes afterwards.",
141
+ "format":"date-time",
142
+ "readonly":true,
143
+ "type":"string"
144
+ },
145
+ "updated_at":{
146
+ "description": "Date the object was edited in SK.",
147
+ "format":"date-time",
148
+ "readonly":true,
149
+ "type":"string"
150
+ },
151
+ "lock_version":{
152
+ "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version.",
153
+ "type":"integer"
154
+ },
155
+ "gross_total":{
156
+ "description": "Gross total of all line items, 2 decimals places in document currency.",
157
+ "readonly":true,
158
+ "type":"number"
159
+ },
160
+ "tax_total":{
161
+ "description": "Tax total, 2 decimals places",
162
+ "readonly":true,
163
+ "type":"number"
164
+ },
165
+ "net_total":{
166
+ "description": "Net total, 2 decimals places",
167
+ "readonly":true,
168
+ "type":"number"
169
+ },
170
+ "net_total_base":{
171
+ "description": "Net total, 6 decimal places incl. discount",
172
+ "readonly":true,
173
+ "type":"number"
174
+ },
175
+ "cost_total":{
176
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
177
+ "readonly":true,
178
+ "type":"number"
179
+ },
180
+ "gross_margin_total":{
181
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
182
+ "readonly":true,
183
+ "type":"number"
184
+ },
185
+ "gross_margin_pct":{
186
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
187
+ "readonly":true,
188
+ "type":"number"
189
+ },
190
+ "probability":{
191
+ "description": "Percentage of estimated confidence in closing the deal. Estimated Probability percentage of the net total amount",
192
+ "type":"number"
193
+ },
194
+ "expected_revenue":{
195
+ "description": "Product of the probability and net total. In company currency.",
196
+ "readonly":true,
197
+ "type":"number"
198
+ },
199
+ "close_date":{
200
+ "description": "Date when the deal is expected to be closed.",
201
+ "type":"number"
202
+ }
203
+ },
204
+ "links":[
205
+ { "rel": "self",
206
+ "href": "estimates/{id}"
207
+ },
208
+ { "rel": "instances",
209
+ "href": "estimates",
210
+ "properties" : {
211
+ "page":{
212
+ "title" : "Page",
213
+ "description": "In paginated results set the page to look for",
214
+ "type":"number"
215
+ },
216
+ "per_page":{
217
+ "title" : "Per page",
218
+ "description": "Results per page. Default is 50, max is 200",
219
+ "type":"number"
220
+ },
221
+ "filter[q]":{
222
+ "title" : "Search",
223
+ "description": "Search in title, number, address field",
224
+ "type":"string"
225
+ },
226
+ "filter[status]":{
227
+ "title" : "Status",
228
+ "description": "A single or a list of status, comma separated: open,closed,draft, rejected, billed",
229
+ "type" : "string"
230
+ },
231
+ "filter[number]":{
232
+ "title" : "Number",
233
+ "description": "Find by exact number",
234
+ "type":"string"
235
+ },
236
+ "filter[tags]":{
237
+ "title" : "Tags",
238
+ "description": "Filter by a space delimited list of tags",
239
+ "type":"string"
240
+ },
241
+ "filter[probability_from]":{
242
+ "title" : "By probability from",
243
+ "description": "Find documents with a probability greater(>=) than given number. Minimum is 0 for percent fields, max 100",
244
+ "type":"number"
245
+ },
246
+ "filter[probability_to]":{
247
+ "title" : "By probability to",
248
+ "description": "Find accounts with a probability smaller(<=) than given number.",
249
+ "type":"number"
250
+ },
251
+ "filter[from]":{
252
+ "title" : "From date",
253
+ "description": "Objects with a date after the date. YYYY-MM-DD",
254
+ "format" : "date",
255
+ "type" : "string"
256
+ },
257
+ "filter[to]":{
258
+ "title" : "To date",
259
+ "description": "Objects with date before the date. YYYY-MM-DD",
260
+ "format" : "date",
261
+ "type" : "string"
262
+ },
263
+ "filter[close_date_from]":{
264
+ "title" : "Close date from",
265
+ "description": "Objects with a closing date after the date. YYYY-MM-DD",
266
+ "format" : "date",
267
+ "type" : "string"
268
+ },
269
+ "filter[close_date_to]":{
270
+ "title" : "Close date to",
271
+ "description": "Objects with closing date before the date. YYYY-MM-DD",
272
+ "format" : "date",
273
+ "type" : "string"
274
+ },
275
+ "filter[created_at_from]":{
276
+ "title" : "Created from",
277
+ "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",
278
+ "format" : "date-time",
279
+ "type" : "string"
280
+ },
281
+ "filter[created_at_to]":{
282
+ "title" : "Created to",
283
+ "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.",
284
+ "format" : "date-time",
285
+ "type" : "string"
286
+ },
287
+ "filter[updated_at_from]":{
288
+ "title" : "Updated from",
289
+ "description": "Objects updated 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 updated on this day are included. A time should be already utc time",
290
+ "format" : "date-time",
291
+ "type" : "string"
292
+ },
293
+ "filter[updated_at_to]":{
294
+ "title" : "Updated to",
295
+ "description": "Objects updated 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 updated on that day are included. A time should be already utc time.",
296
+ "format" : "date-time",
297
+ "type" : "string"
298
+ },
299
+ "filter[languages]":{
300
+ "title" : "Languages",
301
+ "description": "A list of language codes, comma separated",
302
+ "type" : "string"
303
+ },
304
+ "filter[client_ids]":{
305
+ "title" : "Clients",
306
+ "description": "DEPRECATED use contact_ids",
307
+ "type" : "string"
308
+ },
309
+ "filter[contact_ids]":{
310
+ "title" : "Contacts",
311
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
312
+ "type" : "string"
313
+ },
314
+ "filter[ids]":{
315
+ "title" : "Documents",
316
+ "description": "A single or a list of document uuids, comma separated",
317
+ "type" : "string"
318
+ },
319
+ "filter[creator_ids]":{
320
+ "title" : "Creator",
321
+ "description": "Objects created by the given users uuids, comma separated",
322
+ "type" : "string"
323
+ },
324
+ "filter[product_ids]":{
325
+ "title" : "Products",
326
+ "description": "Documents using the given product uuids(comma separated) in their line items.",
327
+ "type" : "string"
328
+ },
329
+ "sort_by":{
330
+ "title" : "Sort by",
331
+ "description": "Sort the results by the given field => number",
332
+ "enum":["title", "number", "created_at", "updated_at", "price_total", "price_tax", "date", "due_date"],
333
+ "type": "string"
334
+ },
335
+ "sort":{
336
+ "title" : "Sort",
337
+ "enum":["ASC","DESC"],
338
+ "description": "Sort the results in ASC or DESC",
339
+ "type": "string"
340
+ }
341
+ }
342
+ },
343
+ { "rel": "destroy",
344
+ "href": "estimates/{id}",
345
+ "method": "DELETE"
346
+ },
347
+ { "rel": "update",
348
+ "href": "estimates/{id}",
349
+ "method": "PUT"
350
+ },
351
+ { "rel": "create",
352
+ "href": "estimates",
353
+ "method": "POST",
354
+ "properties" : {
355
+ "source" : {
356
+ "title" : "Source document id",
357
+ "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.",
358
+ "type" : "string"
359
+ }
360
+ }
361
+ },
362
+ { "rel": "attachments",
363
+ "href": "estimates/{id}/attachments"
364
+ },
365
+ { "rel": "comments",
366
+ "href": "estimates/{id}/comments"
367
+ },
368
+ { "rel": "emails",
369
+ "href": "estimates/{id}/emails"
370
+ },
371
+ { "rel": "emails create",
372
+ "href": "estimates/{id}/emails",
373
+ "method": "POST",
374
+ "properties" : {
375
+ "template_id":{
376
+ "title" : "Template",
377
+ "description": "UUID of an email template to use. If present template fields like subject, body, attachments are used for the current email.",
378
+ "type":"string",
379
+ "maxLength": 22,
380
+ "minLength":22
381
+ },
382
+ "send":{
383
+ "title" : "Send email",
384
+ "description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
385
+ },
386
+ "archived_pdf":{
387
+ "title" : "Attach archived pdf",
388
+ "description": "Adds the archived pdf from the related resource(if it has one)."
389
+ }
390
+ }
391
+ },
392
+ { "rel": "print",
393
+ "href": "estimates/{id}/print",
394
+ "method": "POST",
395
+ "properties" : {
396
+ "template_id" : {
397
+ "title" : "PDF template used for printing",
398
+ "description": "UUID of a pdf template used to print the document. MUST be present",
399
+ "required":true
400
+ },
401
+ "base64" : {
402
+ "title" : "Return the created pdf base64 encoded",
403
+ "description": "If set the new pdf is returned inside the attachment JSON within 'base64' key. Leave empty to save traffic."
404
+ }
405
+ }
406
+ }
407
+ ]
408
+ }