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,60 @@
1
+ {"type":"object",
2
+ "title": "sub",
3
+ "name": "sub",
4
+ "description": "Subscribe to push notifications(webhooks) about object livecycle events like new, update or delete. Only returns subscription for the current app, so you MUST be using oAuth. When a user removes your app its subs are also deleted. <br/>To register you must supply <br/>- callback_url: receives a base64 encode string containing a JSON object with the object in it's latest state, the user_id & subdomain, company_id, hmac-signed with your app secret.<br/>- channel: defining the event, made up of the SINGULAR object name and the action: invoice.delete, payment.new<br/> - register auth_permissions: An app MUST request non-api permissions f.ex.: clients:create. Perms(on company,app,user,team) are checked before any publishing, so if a user cannot create clients in the interface, his apps will not receive any callbacks.",
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
+ "channel":{
15
+ "description": "The channel to which to subscribe. See available at subs/channels.",
16
+ "required":true,
17
+ "type":"string",
18
+ "maxLength": 100
19
+ },
20
+ "callback_url":{
21
+ "description": "An url receiving the notification. The url MUST be within the url of the current app and receives a POST with a single signed_request parameter containing an base64 encoded JSON object.",
22
+ "type":"string",
23
+ "format":"uri",
24
+ "required":true,
25
+ "maxLength": 100
26
+ },
27
+ "created_at":{
28
+ "description": "Date the record was created in SK. Never changes afterwards.",
29
+ "format":"date-time",
30
+ "readonly":true,
31
+ "type":"string"
32
+ },
33
+ "updated_at":{
34
+ "description": "Last date when the record was edited.",
35
+ "format":"date-time",
36
+ "readonly":true,
37
+ "type":"string"
38
+ }
39
+ },
40
+
41
+ "links":[
42
+ { "rel": "self",
43
+ "href": "{id}"
44
+ },
45
+ { "rel": "instances",
46
+ "href": "subs/"
47
+ },
48
+ { "rel": "destroy",
49
+ "href": "subs/{id}",
50
+ "method": "DELETE"
51
+ },
52
+ { "rel": "update",
53
+ "href": "subs/{id}",
54
+ "method": "PUT"
55
+ },
56
+ { "rel": "subs/channels",
57
+ "href": "subs/channels"
58
+ }
59
+ ]
60
+ }
@@ -0,0 +1,57 @@
1
+ { "type":"object",
2
+ "title": "sub_total_item",
3
+ "name": "sub_total_item",
4
+ "description": "A sub-total item shows a sum of the previous line items, e.g. to distinguish hardware and service costs on a document.",
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": "Title of the sub-total e.g. Hardware total",
21
+ "type":"string",
22
+ "maxLength": 50
23
+ },
24
+ "type":{
25
+ "description": "The item type: SubTotalItem. Must be set when creating new items via document.items array",
26
+ "type":"string",
27
+ "maxLength": 20
28
+ },
29
+ "net_total":{
30
+ "description": "Net sub-total",
31
+ "type":"number",
32
+ "readonly":true
33
+ },
34
+ "gross_total":{
35
+ "description": "Gross sub-total",
36
+ "type":"number",
37
+ "readonly":true
38
+ },
39
+ "created_at":{
40
+ "description": "Date the object was created in SK. Never changes afterwards",
41
+ "format":"date-time",
42
+ "readonly":true,
43
+ "type":"string"
44
+ },
45
+ "updated_at":{
46
+ "description": "Date the object was edited in SK.",
47
+ "format":"date-time",
48
+ "readonly":true,
49
+ "type":"string"
50
+ },
51
+ "_destroy":{
52
+ "description": "When set an existing item will be deleted. This switch is used for items passed-in nested inside their parent object(a document), which is default as long as there is no line item endpoint available.",
53
+ "type":"boolean"
54
+ }
55
+ },
56
+ "links":[]
57
+ }
@@ -0,0 +1,76 @@
1
+ { "type":"object",
2
+ "title": "tag",
3
+ "name": "tag",
4
+ "description":"A tag",
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": "The tag itself",
16
+ "readonly":true,
17
+ "type":"string",
18
+ "maxLength": 50
19
+ },
20
+ "taggings_count":{
21
+ "description": "Usage count of this tag, for all objects in whole company scope.",
22
+ "readonly":true,
23
+ "type":"number"
24
+ }
25
+ },
26
+ "links":[
27
+ { "rel": "self",
28
+ "href": "tags/{id}"
29
+ },
30
+ { "rel": "instances",
31
+ "href": "tags",
32
+ "properties" : {
33
+ "page":{
34
+ "title" : "Page",
35
+ "description": "In paginated results set the page to look for",
36
+ "type":"number"
37
+ },
38
+ "per_page":{
39
+ "title" : "Per page",
40
+ "description": "Results per page. Default is 50, max is 200",
41
+ "type":"number"
42
+ },
43
+ "filter[q]":{
44
+ "title" : "Search",
45
+ "description": "Search in name",
46
+ "type":"string"
47
+ },
48
+ "filter[related_object_type]":{
49
+ "title" : "Related object type",
50
+ "description": "Filter tags by their related object base type",
51
+ "type":"string"
52
+ },
53
+ "sort_by":{
54
+ "title" : "Sort by",
55
+ "description": "Sort the results by the given field",
56
+ "enum":["filename","taggings_count"],
57
+ "type": "string"
58
+ },
59
+ "sort":{
60
+ "title" : "Sort",
61
+ "enum":["ASC","DESC"],
62
+ "description": "Sort the results in ASC or DESC",
63
+ "type": "string"
64
+ }
65
+ }
66
+ },
67
+ { "rel": "destroy",
68
+ "href": "tags/{id}",
69
+ "method": "DELETE"
70
+ },
71
+ { "rel": "update",
72
+ "href": "tags/{id}",
73
+ "method": "PUT"
74
+ }
75
+ ]
76
+ }
@@ -0,0 +1,229 @@
1
+ { "type":"object",
2
+ "title": "task",
3
+ "name": "task",
4
+ "description":"An Task 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": "The task title.",
16
+ "required":true,
17
+ "type":"string"
18
+ },
19
+ "description":{
20
+ "description": "Notes, explanations for the task.",
21
+ "required":true,
22
+ "type":"string"
23
+ },
24
+ "status":{
25
+ "description": "New tasks are open by default, unless otherwise stated.",
26
+ "default":"open",
27
+ "enum":["open","closed","overdue"],
28
+ "type":"string"
29
+ },
30
+ "contact_id":{
31
+ "description": "Related contact of the tasks.",
32
+ "type":"string",
33
+ "maxLength": 22,
34
+ "minLength":22
35
+ },
36
+ "contact":{
37
+ "description": "The contact for the task. Use contact_id field to set a contact.",
38
+ "readonly":true,
39
+ "type":"object",
40
+ "properties":{"$ref":"./contact.json#properties"}
41
+ },
42
+ "documents":{
43
+ "description": "A tasks can have many related documents.",
44
+ "type":"array",
45
+ "properties" : {"$ref":"./document.json#properties"}
46
+ },
47
+ "attachments":{
48
+ "description": "Attached files, uploads.",
49
+ "readonly":true,
50
+ "type":"array",
51
+ "properties":{"$ref":"./attachment.json#properties"}
52
+ },
53
+ "assignee_id":{
54
+ "description": "User who should do the tasks.",
55
+ "type":"string",
56
+ "maxLength": 22,
57
+ "minLength":22
58
+ },
59
+ "creator_id":{
60
+ "description": "User who created the tasks.",
61
+ "type":"string",
62
+ "maxLength": 22,
63
+ "minLength":22
64
+ },
65
+ "closed_at":{
66
+ "description": "Date the task was completed.",
67
+ "format":"date",
68
+ "readonly":true,
69
+ "type":"string"
70
+ },
71
+ "created_at":{
72
+ "description": "Date the object was created in SK. Never changes afterwards",
73
+ "format":"date-time",
74
+ "readonly":true,
75
+ "type":"string"
76
+ },
77
+ "updated_at":{
78
+ "description": "Date the object was edited in SK.",
79
+ "format":"date-time",
80
+ "readonly":true,
81
+ "type":"string"
82
+ }
83
+ },
84
+ "links":[
85
+ { "rel": "self",
86
+ "href": "tasks/{id}"
87
+ },
88
+ { "rel": "instances",
89
+ "href": "tasks",
90
+ "properties" : {
91
+ "filter[q]":{
92
+ "title" : "Search",
93
+ "description": "Search in name, description",
94
+ "type":"string"
95
+ },
96
+ "filter[status]":{
97
+ "title" : "Status",
98
+ "description": "A single or a list of status, comma separated: open,closed,overdue",
99
+ "type" : "string"
100
+ },
101
+ "filter[ids]":{
102
+ "title" : "Task IDs",
103
+ "description": "Only find tasks with given ids. Comma-separated list of task IDs.",
104
+ "type" : "string"
105
+ },
106
+ "filter[contact_ids]":{
107
+ "title" : "Contact IDs",
108
+ "description": "Tasks related to given contacts. Comma-separated list of contact IDs.",
109
+ "type" : "string"
110
+ },
111
+ "filter[creator_ids]":{
112
+ "title" : "Creator IDs",
113
+ "description": "Tasks created by given users. Comma-separated list of user IDs.",
114
+ "type" : "string"
115
+ },
116
+ "filter[assignee_ids]":{
117
+ "title" : "Assignee IDs",
118
+ "description": "Tasks assigned to given users. Comma-separated list of user IDs.",
119
+ "type" : "string"
120
+ },
121
+ "filter[due_at_from]":{
122
+ "title" : "From date",
123
+ "description": "Tasks due after the date(>=). YYYY-MM-DD",
124
+ "format" : "date",
125
+ "type" : "string"
126
+ },
127
+ "filter[due_at_to]":{
128
+ "title" : "To date",
129
+ "description": "Tasks due before the date(<=). YYYY-MM-DD",
130
+ "format" : "date",
131
+ "type" : "string"
132
+ },
133
+ "filter[closed_at_from]":{
134
+ "title" : "From date",
135
+ "description": "Tasks closed after the date(>=). YYYY-MM-DD",
136
+ "format" : "date",
137
+ "type" : "string"
138
+ },
139
+ "filter[closed_at_to]":{
140
+ "title" : "To date",
141
+ "description": "Tasks closed before the date(<=). YYYY-MM-DD",
142
+ "format" : "date",
143
+ "type" : "string"
144
+ },
145
+ "filter[updated_at_from]":{
146
+ "title" : "From date",
147
+ "description": "Tasks updated after the date(>=). YYYY-MM-DD",
148
+ "format" : "date",
149
+ "type" : "string"
150
+ },
151
+ "filter[updated_at_to]":{
152
+ "title" : "To date",
153
+ "description": "Tasks updated before the date(<=). YYYY-MM-DD",
154
+ "format" : "date",
155
+ "type" : "string"
156
+ },
157
+ "filter[created_at_from]":{
158
+ "title" : "From date",
159
+ "description": "Tasks created after the date(>=). YYYY-MM-DD",
160
+ "format" : "date",
161
+ "type" : "string"
162
+ },
163
+ "filter[created_at_to]":{
164
+ "title" : "To date",
165
+ "description": "Tasks created before the date(<=). YYYY-MM-DD",
166
+ "format" : "date",
167
+ "type" : "string"
168
+ },
169
+ "page":{
170
+ "title" : "Page",
171
+ "description": "In paginated results set the page to look for",
172
+ "type":"number"
173
+ },
174
+ "per_page":{
175
+ "title" : "Per page",
176
+ "description": "Results per page. Default is 50, max is 200",
177
+ "type":"number"
178
+ },
179
+ "sort_by":{
180
+ "title" : "Sort by",
181
+ "description": "Sort the results by the given field => number",
182
+ "enum":["created_at", "updated_at"],
183
+ "type": "string"
184
+ },
185
+ "sort":{
186
+ "title" : "Sort",
187
+ "enum":["ASC","DESC"],
188
+ "description": "Sort the results in ASC or DESC",
189
+ "type": "string"
190
+ }
191
+ }
192
+ },
193
+ { "rel": "destroy",
194
+ "href": "tasks/{id}",
195
+ "method": "DELETE"
196
+ },
197
+ { "rel": "update",
198
+ "href": "tasks/{id}",
199
+ "method": "PUT"
200
+ },
201
+ { "rel": "create",
202
+ "href": "tasks",
203
+ "method": "POST",
204
+ "properties" : {
205
+ "template_id":{
206
+ "title" : "Task Template",
207
+ "description": "Task template(id) to use. If set template fields like name, description, attachments are used for the new task.",
208
+ "type":"string",
209
+ "maxLength": 22,
210
+ "minLength":22
211
+ },
212
+ "document_id":{
213
+ "title" : "Create a task for the document.",
214
+ "description": "If set: the document, its contact and due date are used for the task. Dont forget to set a task.name though. Useful if you want to create a reminder when the document is due e.g call contact.",
215
+ "type":"string",
216
+ "maxLength": 22,
217
+ "minLength":22
218
+ },
219
+ "source":{
220
+ "title" : "Copy a task.",
221
+ "description": "Uses name, description, contact, documents from given given source task.",
222
+ "type":"string",
223
+ "maxLength": 22,
224
+ "minLength":22
225
+ }
226
+ }
227
+ }
228
+ ]
229
+ }
@@ -0,0 +1,95 @@
1
+ { "type":"object",
2
+ "title": "text_template",
3
+ "name": "text_template",
4
+ "description":"An text_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 which may contain 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. If empty the snippet can be used global. In this case watch not all placeholders are available: a client has different fields than an invoice.",
28
+ "required":true,
29
+ "enum": ["","invoice", "estimate", "credit_note", "payment_reminder", "order", "contact", "email"],
30
+ "type":"string"
31
+ },
32
+ "created_at":{
33
+ "description": "Date the object was created in SK. Never changes afterwards",
34
+ "format":"date-time",
35
+ "readonly":true,
36
+ "type":"string"
37
+ },
38
+ "updated_at":{
39
+ "description": "Date the object was edited in SK.",
40
+ "format":"date-time",
41
+ "readonly":true,
42
+ "type":"string"
43
+ },
44
+ "team_id":{
45
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
46
+ "type":"string",
47
+ "maxLength": 22,
48
+ "minLength":22
49
+ }
50
+ },
51
+ "links":[
52
+ { "rel": "self",
53
+ "href": "text_templates/{id}"
54
+ },
55
+ { "rel": "instances",
56
+ "href": "text_templates",
57
+ "properties" : {
58
+ "page":{
59
+ "title" : "Page",
60
+ "description": "In paginated results set the page to look for",
61
+ "type":"number"
62
+ },
63
+ "per_page":{
64
+ "title" : "Per page",
65
+ "description": "Results per page. Default is 50, max is 200",
66
+ "type":"number"
67
+ },
68
+ "sort_by":{
69
+ "title" : "Sort by",
70
+ "description": "Sort the results by the given field => number",
71
+ "enum":["created_at", "updated_at"],
72
+ "type": "string"
73
+ },
74
+ "sort":{
75
+ "title" : "Sort",
76
+ "enum":["ASC","DESC"],
77
+ "description": "Sort the results in ASC or DESC",
78
+ "type": "string"
79
+ }
80
+ }
81
+ },
82
+ { "rel": "destroy",
83
+ "href": "text_templates/{id}",
84
+ "method": "DELETE"
85
+ },
86
+ { "rel": "update",
87
+ "href": "text_templates/{id}",
88
+ "method": "PUT"
89
+ },
90
+ { "rel": "create",
91
+ "href": "text_templates",
92
+ "method": "POST"
93
+ }
94
+ ]
95
+ }