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,142 @@
1
+ { "type":"object",
2
+ "title": "export",
3
+ "name": "export",
4
+ "description":"An export in SK",
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
+ "collection_type":{
15
+ "description": "The type of data to export. Lower-case singular name of the export data's class(invoice,contact..), see available classes in json schema. Not required for text-exports, getting the type from the export_template.",
16
+ "type":"string",
17
+ "maxLength": 20
18
+ },
19
+ "collection_ids":{
20
+ "description": "Comma separated uuid's of the export objects. The backend uses a mysql text-column limited to ~64kb. 100 uuids are ~2.5kb",
21
+ "required":true,
22
+ "type":"string",
23
+ "format":"text"
24
+ },
25
+ "kind":{
26
+ "description": "The export type. text: uses an export template defined by a template_id. archived_pdf: zip with archived PDF(documents only). allinone_pdf: All archived PDF(Documents) in one big PDF. attachments: All attachments of the given objects as zip. SEPA: bank exports, relies on valid bank information in your company, the exported document and the contact.",
27
+ "required":true,
28
+ "enum": ["text", "archived_pdf", "attachments", "allinone_pdf", "sepa_debit", "sepa_credit"],
29
+ "type":"string"
30
+ },
31
+ "template_id":{
32
+ "description": "A export template uuid. Required for text exports. collection_type can be empty as is forced to the templates type",
33
+ "type":"string",
34
+ "maxLength": 22,
35
+ "minLength":22
36
+ },
37
+ "team_id":{
38
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
39
+ "type":"string",
40
+ "maxLength": 22,
41
+ "minLength":22
42
+ },
43
+ "status":{
44
+ "description": "The export status",
45
+ "readonly":true,
46
+ "enum": ["pending", "in_progress", "failed", "success"],
47
+ "type":"string"
48
+ },
49
+ "log":{
50
+ "description": "Errors and warnings, can contain html markup f.ex. links to contacts with invalid back accounts when doing dtaus export",
51
+ "readonly":true,
52
+ "type":"string",
53
+ "format": "text"
54
+ },
55
+ "attachments":{
56
+ "description": "The exported data as attachment.",
57
+ "readonly":true,
58
+ "type":"array",
59
+ "properties":{"$ref":"./attachment.json#properties"}
60
+ },
61
+ "started_at":{
62
+ "description": "Date the was started",
63
+ "format":"date-time",
64
+ "readonly":true,
65
+ "type":"string"
66
+ },
67
+ "finished_at":{
68
+ "description": "Date the was finished",
69
+ "format":"date-time",
70
+ "readonly":true,
71
+ "type":"string"
72
+ },
73
+ "created_at":{
74
+ "description": "Date the object was created in SK. Never changes afterwards",
75
+ "format":"date-time",
76
+ "readonly":true,
77
+ "type":"string"
78
+ },
79
+ "updated_at":{
80
+ "description": "Date the object was edited in SK.",
81
+ "format":"date-time",
82
+ "readonly":true,
83
+ "type":"string"
84
+ }
85
+ },
86
+ "links":[
87
+ { "rel": "self",
88
+ "href": "exports/{id}"
89
+ },
90
+ { "rel": "instances",
91
+ "href": "exports",
92
+ "properties" : {
93
+ "page":{
94
+ "title" : "Page",
95
+ "description": "In paginated results set the page to look for",
96
+ "type":"number"
97
+ },
98
+ "per_page":{
99
+ "title" : "Per page",
100
+ "description": "Results per page. Default is 50, max is 200",
101
+ "type":"number"
102
+ },
103
+ "filter[from]":{
104
+ "title" : "From date",
105
+ "description": "All objects with a date after the date",
106
+ "format" : "date",
107
+ "type" : "string"
108
+ },
109
+ "filter[to]":{
110
+ "title" : "To date",
111
+ "description": "All objects with date before the date",
112
+ "format" : "date",
113
+ "type" : "string"
114
+ },
115
+ "sort_by":{
116
+ "title" : "Sort by",
117
+ "description": "Sort the results by the given field => number",
118
+ "enum":["created_at", "updated_at"],
119
+ "type": "string"
120
+ },
121
+ "sort":{
122
+ "title" : "Sort",
123
+ "enum":["ASC","DESC"],
124
+ "description": "Sort the results in ASC or DESC",
125
+ "type": "string"
126
+ }
127
+ }
128
+ },
129
+ { "rel": "destroy",
130
+ "href": "exports/{id}",
131
+ "method": "DELETE"
132
+ },
133
+ { "rel": "update",
134
+ "href": "exports/{id}",
135
+ "method": "PUT"
136
+ },
137
+ { "rel": "create",
138
+ "href": "exports",
139
+ "method": "POST"
140
+ }
141
+ ]
142
+ }
@@ -0,0 +1,100 @@
1
+ { "type":"object",
2
+ "title": "export_template",
3
+ "name": "export_template",
4
+ "description":"An export_template in SK",
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
+ "text":{
21
+ "description": "Text with placeholders, replaced when the template is used.",
22
+ "required":true,
23
+ "type":"string",
24
+ "format":"text"
25
+ },
26
+ "kind":{
27
+ "description": "Kind of object the template can be used for.",
28
+ "required":true,
29
+ "enum": ["invoice", "estimate", "credit_note", "payment_reminder", "order", "contact", "payment", "comment", "email", "history", "product","recurring"],
30
+ "type":"string"
31
+ },
32
+ "filename":{
33
+ "description": "Name of the created export file. Date placeholders can be used: %y-%m-%d_%H-%M_clients.csv",
34
+ "type":"string",
35
+ "maxLength": 255
36
+ },
37
+ "created_at":{
38
+ "description": "Date the object was created in SK. Never changes afterwards",
39
+ "format":"date-time",
40
+ "readonly":true,
41
+ "type":"string"
42
+ },
43
+ "updated_at":{
44
+ "description": "Date the object was edited in SK.",
45
+ "format":"date-time",
46
+ "readonly":true,
47
+ "type":"string"
48
+ },
49
+ "team_id":{
50
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
51
+ "type":"string",
52
+ "maxLength": 22,
53
+ "minLength":22
54
+ }
55
+ },
56
+ "links":[
57
+ { "rel": "self",
58
+ "href": "export_templates/{id}"
59
+ },
60
+ { "rel": "instances",
61
+ "href": "export_templates",
62
+ "properties" : {
63
+ "page":{
64
+ "title" : "Page",
65
+ "description": "In paginated results set the page to look for",
66
+ "type":"number"
67
+ },
68
+ "per_page":{
69
+ "title" : "Per page",
70
+ "description": "Results per page. Default is 50, max is 200",
71
+ "type":"number"
72
+ },
73
+ "sort_by":{
74
+ "title" : "Sort by",
75
+ "description": "Sort the results by the given field => number",
76
+ "enum":["created_at", "updated_at"],
77
+ "type": "string"
78
+ },
79
+ "sort":{
80
+ "title" : "Sort",
81
+ "enum":["ASC","DESC"],
82
+ "description": "Sort the results in ASC or DESC",
83
+ "type": "string"
84
+ }
85
+ }
86
+ },
87
+ { "rel": "destroy",
88
+ "href": "export_templates/{id}",
89
+ "method": "DELETE"
90
+ },
91
+ { "rel": "update",
92
+ "href": "export_templates/{id}",
93
+ "method": "PUT"
94
+ },
95
+ { "rel": "create",
96
+ "href": "export_templates",
97
+ "method": "POST"
98
+ }
99
+ ]
100
+ }
@@ -0,0 +1,407 @@
1
+ { "type":"object",
2
+ "title": "invoice",
3
+ "name": "invoice",
4
+ "description": "An invoice",
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 invoice number schema. Auto-assigned when invoice 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 given.",
21
+ "type":"string"
22
+ },
23
+ "date":{
24
+ "description": "Date the invoice is issued. Automatically set when invoice 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 due date of the document. 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. Beware that the overdue-status is virtual as it depends on the real status=open and the document date.",
39
+ "default":"draft",
40
+ "enum":["draft","open","closed","overdue"],
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 in 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 invoice [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
+ "sepa_mandate_id":{
100
+ "description": "SEPA mandate identifier needed in direct debit transactions. This is a unique id given by you to the customer beforehand.",
101
+ "type":"string",
102
+ "maxLength": 35
103
+ },
104
+ "sepa_mandate_signed_at":{
105
+ "description": "Date the SEPA mandate was signed by your customer. Must not be in the future!",
106
+ "format":"date",
107
+ "type":"string"
108
+ },
109
+ "sepa_debit_sequence_type":{
110
+ "description": "SEPA direct debit sequence type. Check with you bank how they handle FRST(first) and FNAL(final) types. When exporting SEPA debit to your bank the type defaults to OOF if blank.",
111
+ "type":"string",
112
+ "enum":["FRST","OOFF","RCUR","FNAL"]
113
+ },
114
+ "client":{
115
+ "description": "DEPRECATED: use contact",
116
+ "readonly":true,
117
+ "type":"object",
118
+ "properties":{"$ref":"./client.json#properties"}
119
+ },
120
+ "client_id":{
121
+ "description": "DEPRECATED: use contact_id",
122
+ "type":"string",
123
+ "maxLength": 22,
124
+ "minLength":22
125
+ },
126
+ "contact":{
127
+ "description": "The contact for the document. Use contact_id field to set a contact.",
128
+ "readonly":true,
129
+ "type":"object",
130
+ "properties":{"$ref":"./contact.json#properties"}
131
+ },
132
+ "contact_id":{
133
+ "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.",
134
+ "type":"string",
135
+ "maxLength": 22,
136
+ "minLength":22
137
+ },
138
+ "team_id":{
139
+ "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.",
140
+ "readonly" :true,
141
+ "type":"string",
142
+ "maxLength": 22,
143
+ "minLength":22
144
+ },
145
+ "line_items":{
146
+ "description": "DEPRECATED use items",
147
+ "type":"array",
148
+ "properties":{"$ref":"./line_item.json#properties"}
149
+ },
150
+ "items":{
151
+ "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.",
152
+ "type":"array",
153
+ "default": "any",
154
+ "minItems": 0,
155
+ "items": [{ "$ref": "./line_item.json#properties"},
156
+ { "$ref": "./divider_item.json#properties"},
157
+ { "$ref": "./sub_total_item.json#properties"}]
158
+ },
159
+ "created_at":{
160
+ "description": "Date the object was created in SK. Never changes afterwards.",
161
+ "format":"date-time",
162
+ "readonly":true,
163
+ "type":"string"
164
+ },
165
+ "updated_at":{
166
+ "description": "Date the object was edited in SK.",
167
+ "format":"date-time",
168
+ "readonly":true,
169
+ "type":"string"
170
+ },
171
+ "lock_version":{
172
+ "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version. ",
173
+ "type":"integer"
174
+ },
175
+ "price_total":{
176
+ "description": "DEPRECATED use net_total_base",
177
+ "readonly":true,
178
+ "type":"number"
179
+ },
180
+ "price_tax":{
181
+ "description": "DEPRECATED: use tax_total",
182
+ "readonly":true,
183
+ "type":"number"
184
+ },
185
+ "gross_total":{
186
+ "description": "Gross total of all line items, 2 decimals places in document currency.",
187
+ "readonly":true,
188
+ "type":"number"
189
+ },
190
+ "tax_total":{
191
+ "description": "Tax total, 2 decimals places",
192
+ "readonly":true,
193
+ "type":"number"
194
+ },
195
+ "net_total":{
196
+ "description": "Net total, 2 decimals places",
197
+ "readonly":true,
198
+ "type":"number"
199
+ },
200
+ "net_total_base":{
201
+ "description": "Net total, 6 decimal places incl. discount",
202
+ "readonly":true,
203
+ "type":"number"
204
+ },
205
+ "cost_total":{
206
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
207
+ "readonly":true,
208
+ "type":"number"
209
+ },
210
+ "gross_margin_total":{
211
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
212
+ "readonly":true,
213
+ "type":"number"
214
+ },
215
+ "gross_margin_pct":{
216
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
217
+ "readonly":true,
218
+ "type":"number"
219
+ },
220
+ "recurring_id":{
221
+ "description":"Recurring document ID, if the invoice was created from a recurring.",
222
+ "readonly":true,
223
+ "type":"string",
224
+ "maxLength": 22,
225
+ "minLength": 22
226
+ }
227
+ },
228
+ "links":[
229
+ { "rel": "self",
230
+ "href": "invoices/{id}"
231
+ },
232
+ { "rel": "instances",
233
+ "href": "invoices",
234
+ "properties" : {
235
+ "page":{
236
+ "title" : "Page",
237
+ "description": "In paginated results set the page to look for",
238
+ "type":"number"
239
+ },
240
+ "per_page":{
241
+ "title" : "Per page",
242
+ "description": "Results per page. Default is 50, max is 200",
243
+ "type":"number"
244
+ },
245
+ "filter[q]":{
246
+ "title" : "Search",
247
+ "description": "Search in title, number, address field",
248
+ "type":"string"
249
+ },
250
+ "filter[status]":{
251
+ "title" : "Status",
252
+ "description": "A single or a list of status, comma separated: open,closed,overdue,draft",
253
+ "type" : "string"
254
+ },
255
+ "filter[number]":{
256
+ "title" : "Number",
257
+ "description": "Find by exact number",
258
+ "type":"string"
259
+ },
260
+ "filter[tags]":{
261
+ "title" : "Tags",
262
+ "description": "Filter by a space delimited list of tags",
263
+ "type":"string"
264
+ },
265
+ "filter[from]":{
266
+ "title" : "From date",
267
+ "description": "Objects with a date after the date. YYYY-MM-DD",
268
+ "format" : "date",
269
+ "type" : "string"
270
+ },
271
+ "filter[to]":{
272
+ "title" : "To date",
273
+ "description": "Objects with date before the date. YYYY-MM-DD",
274
+ "format" : "date",
275
+ "type" : "string"
276
+ },
277
+ "filter[languages]":{
278
+ "title" : "Languages",
279
+ "description": "A list of language codes, comma separated",
280
+ "type" : "string"
281
+ },
282
+ "filter[client_ids]":{
283
+ "title" : "Clients",
284
+ "description": "DEPRECATED use contact_ids",
285
+ "type" : "string"
286
+ },
287
+ "filter[contact_ids]":{
288
+ "title" : "Contacts",
289
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
290
+ "type" : "string"
291
+ },
292
+ "filter[ids]":{
293
+ "title" : "Documents",
294
+ "description": "A single or a list of document uuids, comma separated",
295
+ "type" : "string"
296
+ },
297
+ "filter[creator_ids]":{
298
+ "title" : "Creator",
299
+ "description": "Objects created by the given users uuids, comma separated",
300
+ "type" : "string"
301
+ },
302
+ "filter[recurring_ids]":{
303
+ "title" : "Recurrings",
304
+ "description": "Documents belonging to the given recurring uuids, comma separated",
305
+ "type" : "string"
306
+ },
307
+ "filter[product_ids]":{
308
+ "title" : "Products",
309
+ "description": "Documents using the given product uuids(comma separated) in their line items.",
310
+ "type" : "string"
311
+ },
312
+ "sort_by":{
313
+ "title" : "Sort by",
314
+ "description": "Sort the results by the given field => number",
315
+ "enum":["title", "number", "created_at", "updated_at", "price_total", "price_tax", "date", "due_date"],
316
+ "type": "string"
317
+ },
318
+ "sort":{
319
+ "title" : "Sort",
320
+ "enum":["ASC","DESC"],
321
+ "description": "Sort the results in ASC or DESC",
322
+ "type": "string"
323
+ }
324
+ }
325
+ },
326
+ { "rel": "destroy",
327
+ "href": "invoices/{id}",
328
+ "method": "DELETE"
329
+ },
330
+ { "rel": "update",
331
+ "href": "invoices/{id}",
332
+ "method": "PUT"
333
+ },
334
+ { "rel": "create",
335
+ "href": "invoices",
336
+ "method": "POST",
337
+ "properties" : {
338
+ "source" : {
339
+ "title" : "Source document id",
340
+ "description": "Copies the source(excl. number,date) and returns a new draft document. Fields passed with the object(e.g. notes, title, address_field) are not overwritten. When copying a different document type e.g. creating an invoice from an order(pass an order ID), ONLY the items, contact, currency and tag list are taken from the source doc.",
341
+ "type" : "string"
342
+ },
343
+ "cancel" : {
344
+ "title" : "Cancel an invoice",
345
+ "description": "Cancelling a document copies the source and negates all line item values. A source id MUST be set.",
346
+ "dependencies": ["source"],
347
+ "type":"boolean"
348
+ }
349
+ }
350
+ },
351
+ { "rel": "attachments",
352
+ "href": "invoices/{id}/attachments"
353
+ },
354
+ { "rel": "payments",
355
+ "href": "invoices/{id}/payments"
356
+ },
357
+ { "rel": "payment_reminders",
358
+ "href": "invoices/{id}/payment_reminders"
359
+ },
360
+ { "rel": "comments",
361
+ "href": "invoices/{id}/comments"
362
+ },
363
+ { "rel": "emails",
364
+ "href": "invoices/{id}/emails"
365
+ },
366
+ { "rel": "emails create",
367
+ "href": "invoices/{id}/emails",
368
+ "method": "POST",
369
+ "properties" : {
370
+ "template_id":{
371
+ "title" : "Template",
372
+ "description": "UUID of an email template to use. If present template fields like subject, body, attachments are used for the current email.",
373
+ "type":"string",
374
+ "maxLength": 22,
375
+ "minLength":22
376
+ },
377
+ "send":{
378
+ "title" : "Send email",
379
+ "description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
380
+ },
381
+ "archived_pdf":{
382
+ "title" : "Attach archived pdf",
383
+ "description": "Adds the archived pdf from the related resource(if it has one)."
384
+ }
385
+ }
386
+ },
387
+ { "rel": "payment create",
388
+ "href": "invoices/{id}/payments",
389
+ "method": "POST"
390
+ },
391
+ { "rel": "print",
392
+ "href": "invoices/{id}/print",
393
+ "method": "POST",
394
+ "properties" : {
395
+ "template_id" : {
396
+ "title" : "PDF template used for printing",
397
+ "description": "UUID of a pdf template used to print the document. MUST be present",
398
+ "required":true
399
+ },
400
+ "base64" : {
401
+ "title" : "Return the created pdf base64 encoded",
402
+ "description": "If set(any val) the new pdf is returned inside the attachment JSON within 'base64' key. Ommit to save traffic."
403
+ }
404
+ }
405
+ }
406
+ ]
407
+ }