sk_api_schema 0.10.6 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -2
  3. data/CHANGELOG.md +4 -0
  4. data/README.rdoc +1 -1
  5. data/Rakefile +0 -10
  6. data/json/v1.0/account.json +13 -0
  7. data/json/v1.0/contact.json +7 -1
  8. data/json/v1.0/credit_note.json +6 -0
  9. data/json/v1.0/invoice.json +6 -0
  10. data/json/v1.0/order.json +6 -0
  11. data/json/v1.0/product.json +0 -4
  12. data/json/v1.0/recurring.json +6 -0
  13. data/json/v2.0/README.md +28 -0
  14. data/json/v2.0/account.json +31 -18
  15. data/json/v2.0/account_billing.json +15 -7
  16. data/json/v2.0/account_entry.json +19 -16
  17. data/json/v2.0/address.json +7 -6
  18. data/json/v2.0/attachment.json +17 -16
  19. data/json/v2.0/auth_permission.json +6 -5
  20. data/json/v2.0/comment.json +15 -9
  21. data/json/v2.0/company.json +11 -8
  22. data/json/v2.0/contact.json +45 -49
  23. data/json/v2.0/credit_note.json +59 -84
  24. data/json/v2.0/divider_item.json +9 -8
  25. data/json/v2.0/document.json +41 -36
  26. data/json/v2.0/email.json +29 -22
  27. data/json/v2.0/email_template.json +15 -10
  28. data/json/v2.0/estimate.json +59 -76
  29. data/json/v2.0/export.json +26 -16
  30. data/json/v2.0/export_template.json +15 -9
  31. data/json/v2.0/invoice.json +62 -92
  32. data/json/v2.0/language.json +14 -6
  33. data/json/v2.0/line_item.json +14 -13
  34. data/json/v2.0/order.json +59 -75
  35. data/json/v2.0/payment.json +17 -12
  36. data/json/v2.0/payment_reminder.json +53 -71
  37. data/json/v2.0/pdf_template.json +14 -8
  38. data/json/v2.0/product.json +16 -13
  39. data/json/v2.0/recurring.json +57 -54
  40. data/json/v2.0/sub.json +14 -7
  41. data/json/v2.0/sub_total_item.json +10 -9
  42. data/json/v2.0/tag.json +13 -5
  43. data/json/v2.0/task.json +31 -16
  44. data/json/v2.0/text_template.json +16 -10
  45. data/json/v2.0/user.json +8 -8
  46. data/lib/sk_api_schema/version.rb +1 -1
  47. data/sk_api_schema.gemspec +1 -1
  48. data/spec/sk_api_schema_spec.rb +35 -19
  49. data/spec/spec_helper.rb +1 -2
  50. metadata +7 -7
  51. data/json/v2.0/client.json +0 -318
@@ -1,12 +1,14 @@
1
- { "type":"object",
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type":"object",
2
4
  "title": "line_item",
3
- "name": "line_item",
4
5
  "description": "A line item for a document",
6
+ "required": ["price_single"],
5
7
  "properties":{
6
8
  "id":{
7
9
  "description":"Unique identifier - UUID",
8
10
  "identity":true,
9
- "readonly":true,
11
+ "readOnly":true,
10
12
  "type":"string",
11
13
  "maxLength": 22,
12
14
  "minLength":22
@@ -34,12 +36,11 @@
34
36
  "description":{
35
37
  "description": "Item description",
36
38
  "type":"string",
37
- "format": "text"
39
+ "format": "string"
38
40
  },
39
41
  "price_single":{
40
42
  "description": "Net price of a single item. If a product id is given, price_single is taken from the product if not set. Max 6 decimal places.",
41
- "type":"number",
42
- "required" : true
43
+ "type":"number"
43
44
  },
44
45
  "cost":{
45
46
  "description": "Cost price for a single item. Used to calculate the gross margin. Max 6 decimal places.",
@@ -47,27 +48,27 @@
47
48
  },
48
49
  "cost_total":{
49
50
  "description": "Total costs. Calculated from cost_single * quantity",
50
- "readonly":true,
51
+ "readOnly":true,
51
52
  "type":"number"
52
53
  },
53
54
  "gross_margin_total":{
54
55
  "description": "Gross margin, the difference between revenue and cost before accounting for certain other costs. Calculated from net_total - cost_total",
55
- "readonly":true,
56
+ "readOnly":true,
56
57
  "type":"number"
57
58
  },
58
59
  "gross_margin_pct":{
59
60
  "description": "Gross margin percentage. Calculated from gross_margin_total/cost_total",
60
- "readonly":true,
61
+ "readOnly":true,
61
62
  "type":"number"
62
63
  },
63
64
  "net_total":{
64
65
  "description": "Net price of a single item. Calculated from price_single * quantity * discount",
65
- "readonly":true,
66
+ "readOnly":true,
66
67
  "type":"number"
67
68
  },
68
69
  "gross_total":{
69
70
  "description": "Gross price. Net total with taxes applied.",
70
- "readonly":true,
71
+ "readOnly":true,
71
72
  "type":"number"
72
73
  },
73
74
  "tax":{
@@ -103,13 +104,13 @@
103
104
  "created_at":{
104
105
  "description": "Date the object was created in SK. Never changes afterwards",
105
106
  "format":"date-time",
106
- "readonly":true,
107
+ "readOnly":true,
107
108
  "type":"string"
108
109
  },
109
110
  "updated_at":{
110
111
  "description": "Date the object was edited in SK.",
111
112
  "format":"date-time",
112
- "readonly":true,
113
+ "readOnly":true,
113
114
  "type":"string"
114
115
  },
115
116
  "_destroy":{
@@ -1,12 +1,20 @@
1
- { "type":"object",
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type":"object",
2
4
  "title": "order",
3
- "name": "order",
4
5
  "description": "An order",
5
6
  "properties":{
6
7
  "id":{
7
8
  "description":"Unique identifier - UUID",
8
9
  "identity":true,
9
- "readonly":true,
10
+ "readOnly":true,
11
+ "type":"string",
12
+ "maxLength": 22,
13
+ "minLength":22
14
+ },
15
+ "company_id":{
16
+ "description":"Company",
17
+ "readOnly":true,
10
18
  "type":"string",
11
19
  "maxLength": 22,
12
20
  "minLength":22
@@ -58,12 +66,12 @@
58
66
  "notes_before":{
59
67
  "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
60
68
  "type":"string",
61
- "format":"text"
69
+ "format":"string"
62
70
  },
63
71
  "notes_after":{
64
72
  "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
73
  "type":"string",
66
- "format":"text"
74
+ "format":"string"
67
75
  },
68
76
  "tag_list":{
69
77
  "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
@@ -82,37 +90,25 @@
82
90
  },
83
91
  "exchange_rate":{
84
92
  "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,
93
+ "readOnly":true,
86
94
  "type":"number"
87
95
  },
88
96
  "gross_total_exchanged":{
89
97
  "description": "Exchanged gross total, in your company currency.",
90
- "readonly":true,
98
+ "readOnly":true,
91
99
  "type":"number"
92
100
  },
93
101
  "archived_pdf":{
94
102
  "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,
103
+ "readOnly":true,
96
104
  "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
105
+ "$ref":"./attachment.json#"
110
106
  },
111
107
  "contact":{
112
108
  "description": "The contact for the document. Use contact_id field to set a contact.",
113
- "readonly":true,
109
+ "readOnly":true,
114
110
  "type":"object",
115
- "properties":{"$ref":"./contact.json#properties"}
111
+ "$ref":"./contact.json#"
116
112
  },
117
113
  "contact_id":{
118
114
  "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.",
@@ -122,82 +118,97 @@
122
118
  },
123
119
  "estimate_id":{
124
120
  "description":"Estimate document ID, if the order was created from a estimate.",
125
- "readonly":true,
121
+ "readOnly":true,
126
122
  "type":"string",
127
123
  "maxLength": 22,
128
124
  "minLength": 22
129
125
  },
130
126
  "team_id":{
131
127
  "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.",
132
- "readonly" :true,
128
+ "readOnly" :true,
133
129
  "type":"string",
134
130
  "maxLength": 22,
135
131
  "minLength":22
136
132
  },
137
- "line_items":{
138
- "description": "DEPRECATED use items",
139
- "type":"array",
140
- "properties":{"$ref":"./line_item.json#properties"}
141
- },
142
133
  "items":{
143
- "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.",
134
+ "description": "Items for the document, including divider and sub_total items. You MUST set the type field(CamelCasedItem class name) on each item on creation.",
144
135
  "type":"array",
145
- "default": "any",
146
136
  "minItems": 0,
147
- "items": [{ "$ref": "./line_item.json#properties"},
148
- { "$ref": "./divider_item.json#properties"},
149
- { "$ref": "./sub_total_item.json#properties"}]
137
+ "items": {
138
+ "type" : "object",
139
+ "anyOf" : [
140
+ {
141
+ "title": "line_item",
142
+ "$ref": "./line_item.json#"
143
+ },
144
+ {
145
+ "title": "divider_item",
146
+ "$ref": "./divider_item.json#"
147
+ },
148
+ {
149
+ "title": "sub_total_item",
150
+ "$ref": "./sub_total_item.json#"
151
+ }
152
+ ]
153
+ }
150
154
  },
151
155
  "created_at":{
152
156
  "description": "Date the object was created in SK. Never changes afterwards.",
153
157
  "format":"date-time",
154
- "readonly":true,
158
+ "readOnly":true,
155
159
  "type":"string"
156
160
  },
157
161
  "updated_at":{
158
162
  "description": "Date the object was edited in SK.",
159
163
  "format":"date-time",
160
- "readonly":true,
164
+ "readOnly":true,
161
165
  "type":"string"
162
166
  },
163
167
  "lock_version":{
164
168
  "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version.",
169
+ "readOnly":true,
165
170
  "type":"integer"
166
171
  },
167
172
  "gross_total":{
168
173
  "description": "Gross total of all line items, 2 decimals places in document currency.",
169
- "readonly":true,
174
+ "readOnly":true,
170
175
  "type":"number"
171
176
  },
172
177
  "tax_total":{
173
178
  "description": "Tax total, 2 decimals places",
174
- "readonly":true,
179
+ "readOnly":true,
175
180
  "type":"number"
176
181
  },
177
182
  "net_total":{
178
183
  "description": "Net total, 2 decimals places",
179
- "readonly":true,
184
+ "readOnly":true,
180
185
  "type":"number"
181
186
  },
182
187
  "net_total_base":{
183
188
  "description": "Net total, 6 decimal places incl. discount",
184
- "readonly":true,
189
+ "readOnly":true,
185
190
  "type":"number"
186
191
  },
187
192
  "cost_total":{
188
193
  "description": "Cost total of all line items, 2 decimals places in document currency.",
189
- "readonly":true,
194
+ "readOnly":true,
190
195
  "type":"number"
191
196
  },
192
197
  "gross_margin_total":{
193
198
  "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
194
- "readonly":true,
199
+ "readOnly":true,
195
200
  "type":"number"
196
201
  },
197
202
  "gross_margin_pct":{
198
203
  "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
199
- "readonly":true,
204
+ "readOnly":true,
200
205
  "type":"number"
206
+ },
207
+ "tax_exemption_id":{
208
+ "description": "ID of a tax exemption. When set all item taxes are omitted.",
209
+ "type":"string",
210
+ "maxLength": 22,
211
+ "minLength":22
201
212
  }
202
213
  },
203
214
  "links":[
@@ -266,11 +277,6 @@
266
277
  "description": "A list of language codes, comma separated",
267
278
  "type" : "string"
268
279
  },
269
- "filter[client_ids]":{
270
- "title" : "Clients",
271
- "description": "DEPRECATED use contact_ids",
272
- "type" : "string"
273
- },
274
280
  "filter[contact_ids]":{
275
281
  "title" : "Contacts",
276
282
  "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
@@ -325,34 +331,13 @@
325
331
  }
326
332
  },
327
333
  { "rel": "attachments",
328
- "href": "orders/{id}/attachments"
334
+ "href": "attachments?filter[related_object_ids]={id}"
329
335
  },
330
336
  { "rel": "comments",
331
- "href": "orders/{id}/comments"
337
+ "href": "comments?filter[related_object_ids]={id}"
332
338
  },
333
339
  { "rel": "emails",
334
- "href": "orders/{id}/emails"
335
- },
336
- { "rel": "emails create",
337
- "href": "orders/{id}/emails",
338
- "method": "POST",
339
- "properties" : {
340
- "template_id":{
341
- "title" : "Template",
342
- "description": "UUID of an email template to use. If present template fields like subject, body, attachments are used for the current email.",
343
- "type":"string",
344
- "maxLength": 22,
345
- "minLength":22
346
- },
347
- "send":{
348
- "title" : "Send email",
349
- "description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
350
- },
351
- "archived_pdf":{
352
- "title" : "Attach archived pdf",
353
- "description": "Adds the archived pdf from the related resource(if it has one)."
354
- }
355
- }
340
+ "href": "emails?filter[related_object_ids]={id}"
356
341
  },
357
342
  { "rel": "print",
358
343
  "href": "orders/{id}/print",
@@ -360,8 +345,7 @@
360
345
  "properties" : {
361
346
  "template_id" : {
362
347
  "title" : "PDF template used for printing",
363
- "description": "UUID of a pdf template used to print the document. MUST be present",
364
- "required":true
348
+ "description": "UUID of a pdf template used to print the document. MUST be present"
365
349
  },
366
350
  "base64" : {
367
351
  "title" : "Return the created pdf base64 encoded",
@@ -1,19 +1,27 @@
1
- { "type":"object",
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type":"object",
2
4
  "title": "payment",
3
- "name": "payment",
4
- "description":"An payment must always be related to an document, so you must use the nested URL e.g. POST invoices/ID/payments. In this case the related_object_id/type are automatically set.",
5
+ "description":"An payment must always be related to an document, either an invoice(incoming) or a credit_note (outgoing).",
6
+ "required":["amount","date", "related_object_type", "related_object_id"],
5
7
  "properties":{
6
8
  "id":{
7
9
  "description":"Unique identifier - UUID",
8
10
  "identity":true,
9
- "readonly":true,
11
+ "readOnly":true,
12
+ "type":"string",
13
+ "maxLength": 22,
14
+ "minLength":22
15
+ },
16
+ "company_id":{
17
+ "description":"Company",
18
+ "readOnly":true,
10
19
  "type":"string",
11
20
  "maxLength": 22,
12
21
  "minLength":22
13
22
  },
14
23
  "amount":{
15
24
  "description": "The payment amount",
16
- "required":true,
17
25
  "type":"number"
18
26
  },
19
27
  "cash_discount":{
@@ -32,7 +40,6 @@
32
40
  },
33
41
  "date":{
34
42
  "description": "Date the payment was made. YYYY-MM-DD",
35
- "required":true,
36
43
  "format":"date",
37
44
  "type":"string"
38
45
  },
@@ -44,12 +51,12 @@
44
51
  },
45
52
  "exchange_rate":{
46
53
  "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. ",
47
- "readonly":true,
54
+ "readOnly":true,
48
55
  "type":"number"
49
56
  },
50
57
  "amount_exchanged":{
51
58
  "description": "The exchanged amount.",
52
- "readonly":true,
59
+ "readOnly":true,
53
60
  "type":"number"
54
61
  },
55
62
  "payment_method":{
@@ -63,19 +70,17 @@
63
70
  },
64
71
  "related_object_type":{
65
72
  "description": "Object type of the payments parent. Is the camel-cased base class name: Document for invoice, credit_note. Is auto-set when using the nested URL POST invoices/ID/payments",
66
- "required":true,
67
73
  "type":"string"
68
74
  },
69
75
  "related_object_id":{
70
76
  "description": "uuid of the payments parent object. Is auto-set when using the nested URL POST invoices/ID/payments",
71
- "required":true,
72
77
  "type":"string",
73
78
  "maxLength": 22,
74
79
  "minLength":22
75
80
  },
76
81
  "team_id":{
77
82
  "description": "A team uuid taken from the related object(e.g.invoice). If set only the team and its parent teams can see the record.",
78
- "readonly" :true,
83
+ "readOnly" :true,
79
84
  "type":"string",
80
85
  "maxLength": 22,
81
86
  "minLength":22
@@ -83,7 +88,7 @@
83
88
  "created_at":{
84
89
  "description": "Date the object was created in SK. Never changes afterwards",
85
90
  "format":"date-time",
86
- "readonly":true,
91
+ "readOnly":true,
87
92
  "type":"string"
88
93
  }
89
94
  },
@@ -1,19 +1,27 @@
1
- { "type":"object",
1
+ {
2
+ "$schema": "http://json-schema.org/draft-04/schema#",
3
+ "type":"object",
2
4
  "title": "payment_reminder",
3
- "name": "payment_reminder",
4
5
  "description": "A payment reminder belongs to an invoice and inherits it's line items from the invoice total(first item) and late fee settings(second item).",
6
+ "required": ["invoice_id", "date"],
5
7
  "properties":{
6
8
  "id":{
7
9
  "description":"Unique identifier - UUID",
8
10
  "identity":true,
9
- "readonly":true,
11
+ "readOnly":true,
12
+ "type":"string",
13
+ "maxLength": 22,
14
+ "minLength":22
15
+ },
16
+ "company_id":{
17
+ "description":"Company",
18
+ "readOnly":true,
10
19
  "type":"string",
11
20
  "maxLength": 22,
12
21
  "minLength":22
13
22
  },
14
23
  "invoice_id":{
15
24
  "description": "The invoice for the reminder. If set assumes all other fields are set to custom values, instead of filling them from the invoice. POSTing to invoices/:id/payment_reminders, automatically set this and all other fields.",
16
- "required": true,
17
25
  "type":"string",
18
26
  "maxLength": 22,
19
27
  "minLength":22
@@ -25,7 +33,6 @@
25
33
  "date":{
26
34
  "description": "Date the payment_reminder is issued. Automatically set when created from invoice. Defaults to today. YYYY-MM-DD",
27
35
  "format":"date",
28
- "required": true,
29
36
  "type":"string"
30
37
  },
31
38
  "due_days":{
@@ -56,12 +63,12 @@
56
63
  "notes_before":{
57
64
  "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used. Defaults to values from settings",
58
65
  "type":"string",
59
- "format":"text"
66
+ "format":"string"
60
67
  },
61
68
  "notes_after":{
62
69
  "description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used. Defaults to values from settings",
63
70
  "type":"string",
64
- "format":"text"
71
+ "format":"string"
65
72
  },
66
73
  "tag_list":{
67
74
  "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
@@ -80,88 +87,87 @@
80
87
  },
81
88
  "exchange_rate":{
82
89
  "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. ",
83
- "readonly":true,
90
+ "readOnly":true,
84
91
  "type":"number"
85
92
  },
86
93
  "gross_total_exchanged":{
87
94
  "description": "Exchanged gross total, in your company currency.",
88
- "readonly":true,
95
+ "readOnly":true,
89
96
  "type":"number"
90
97
  },
91
98
  "archived_pdf":{
92
99
  "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. ",
93
- "readonly":true,
94
- "type":"object",
95
- "properties":{"$ref":"./attachment.json#properties"}
96
- },
97
- "client":{
98
- "description": "DEPRECATED: use contact",
99
- "readonly":true,
100
+ "readOnly":true,
100
101
  "type":"object",
101
- "properties":{"$ref":"./client.json#properties"}
102
- },
103
- "client_id":{
104
- "description": "DEPRECATED: use contact_id",
105
- "type":"string",
106
- "maxLength": 22,
107
- "minLength":22
102
+ "$ref":"./attachment.json#"
108
103
  },
109
104
  "contact":{
110
105
  "description": "The contact for the document. Is assigned through the related invoice.",
111
- "readonly":true,
106
+ "readOnly":true,
112
107
  "type":"object",
113
- "properties":{"$ref":"./contact.json#properties"}
108
+ "$ref":"./contact.json#"
114
109
  },
115
110
  "contact_id":{
116
111
  "description": "The contact uuid. Is assigned through the related invoice.",
117
- "readonly":true,
112
+ "readOnly":true,
118
113
  "type":"string",
119
114
  "maxLength": 22,
120
115
  "minLength":22
121
116
  },
122
117
  "team_id":{
123
118
  "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.",
124
- "readonly" :true,
119
+ "readOnly" :true,
125
120
  "type":"string",
126
121
  "maxLength": 22,
127
122
  "minLength":22
128
123
  },
129
- "line_items":{
130
- "description": "DEPRECATED use items",
131
- "type":"array",
132
- "properties":{"$ref":"./line_item.json#properties"}
133
- },
134
124
  "items":{
135
- "description": "Items for the document. GOTCHAs: you should NOT create items manually since we create them. The first item contains the invoice total and the optional second one the late_fee.",
125
+ "description": "Items for the document, including divider and sub_total items. You MUST set the type field(CamelCasedItem class name) on each item on creation.",
136
126
  "type":"array",
137
- "default": "any",
138
- "minItems": 1,
139
- "items": { "$ref": "./line_item.json#properties"}
127
+ "minItems": 0,
128
+ "items": {
129
+ "type" : "object",
130
+ "anyOf" : [
131
+ {
132
+ "title": "line_item",
133
+ "$ref": "./line_item.json#"
134
+ },
135
+ {
136
+ "title": "divider_item",
137
+ "$ref": "./divider_item.json#"
138
+ },
139
+ {
140
+ "title": "sub_total_item",
141
+ "$ref": "./sub_total_item.json#"
142
+ }
143
+ ]
144
+ }
140
145
  },
141
146
  "created_at":{
142
147
  "description": "Date the object was created in SK. Never changes afterwards.",
143
148
  "format":"date-time",
144
- "readonly":true,
149
+ "readOnly":true,
145
150
  "type":"string"
146
151
  },
147
152
  "updated_at":{
148
153
  "description": "Date the object was edited in SK.",
149
154
  "format":"date-time",
150
- "readonly":true,
155
+ "readOnly":true,
151
156
  "type":"string"
152
157
  },
153
158
  "lock_version":{
154
- "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version. ",
159
+ "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version.",
160
+ "readOnly":true,
155
161
  "type":"integer"
156
162
  },
157
163
  "gross_total":{
158
164
  "description": "DEPRECATED use net_total bcs there are no taxes applied",
159
- "readonly":true,
165
+ "readOnly":true,
160
166
  "type":"number"
161
167
  },
162
168
  "net_total":{
163
169
  "description": "Net total, 2 decimals places",
164
- "readonly":true,
170
+ "readOnly":true,
165
171
  "type":"number"
166
172
  }
167
173
  },
@@ -209,11 +215,6 @@
209
215
  "description": "A list of language codes, comma separated",
210
216
  "type" : "string"
211
217
  },
212
- "filter[client_ids]":{
213
- "title" : "Clients",
214
- "description": "DEPRECATED use contact_ids",
215
- "type" : "string"
216
- },
217
218
  "filter[contact_ids]":{
218
219
  "title" : "Contacts",
219
220
  "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
@@ -256,31 +257,13 @@
256
257
  "method": "POST"
257
258
  },
258
259
  { "rel": "attachments",
259
- "href": "payment_reminders/{id}/attachments"
260
+ "href": "attachments?filter[related_object_ids]={id}"
260
261
  },
261
- { "rel": "emails",
262
- "href": "payment_reminders/{id}/emails"
262
+ { "rel": "comments",
263
+ "href": "comments?filter[related_object_ids]={id}"
263
264
  },
264
- { "rel": "emails create",
265
- "href": "payment_reminders/{id}/emails",
266
- "method": "POST",
267
- "properties" : {
268
- "template_id":{
269
- "title" : "Template",
270
- "description": "UUID of an email template to use. If present template fields like subject, body, attachments are used for the current email.",
271
- "type":"string",
272
- "maxLength": 22,
273
- "minLength":22
274
- },
275
- "send":{
276
- "title" : "Send email",
277
- "description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
278
- },
279
- "archived_pdf":{
280
- "title" : "Attach archived pdf",
281
- "description": "Adds the archived pdf from the related resource(if it has one)."
282
- }
283
- }
265
+ { "rel": "emails",
266
+ "href": "emails?filter[related_object_ids]={id}"
284
267
  },
285
268
  { "rel": "print",
286
269
  "href": "payment_reminders/{id}/print",
@@ -288,8 +271,7 @@
288
271
  "properties" : {
289
272
  "template_id" : {
290
273
  "title" : "PDF template used for printing",
291
- "description": "UUID of a pdf template used to print the document. MUST be present",
292
- "required":true
274
+ "description": "UUID of a pdf template used to print the document. MUST be present"
293
275
  },
294
276
  "base64" : {
295
277
  "title" : "Return the created pdf base64 encoded",