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,144 @@
1
+ { "type":"object",
2
+ "title": "product",
3
+ "name": "product",
4
+ "description": "A product 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
+ "number":{
15
+ "description": "Unique number assigned by you or if empty SK product number schema.",
16
+ "type":"string",
17
+ "maxLength": 50
18
+ },
19
+ "name":{
20
+ "description": "The name of the product",
21
+ "type":"string",
22
+ "required":true,
23
+ "maxLength": 50
24
+ },
25
+ "description":{
26
+ "description": "Product description",
27
+ "type":"string",
28
+ "format":"text"
29
+ },
30
+ "tag_list":{
31
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
32
+ "type":"string"
33
+ },
34
+ "price":{
35
+ "description": "Net price of a single product. Max 6 decimal places.",
36
+ "type":"number",
37
+ "required":true
38
+ },
39
+ "cost":{
40
+ "description": "Cost price of a single product. Max 6 decimal places.",
41
+ "type":"number"
42
+ },
43
+ "category_name":{
44
+ "description": "Name of the product category. A new category is created if it does not exist.",
45
+ "type":"string",
46
+ "maxLength": 255
47
+ },
48
+ "tax":{
49
+ "description": "Tax percentage for this product.",
50
+ "type":"number"
51
+ },
52
+ "quantity_unit":{
53
+ "description": "Unit like kg, days, month.",
54
+ "type":"string",
55
+ "maxLength": 30
56
+ },
57
+ "created_at":{
58
+ "description": "Date the object was created in SK. Never changes afterwards",
59
+ "format":"date-time",
60
+ "readonly":true,
61
+ "type":"string"
62
+ },
63
+ "updated_at":{
64
+ "description": "Date the object was edited in SK.",
65
+ "format":"date-time",
66
+ "readonly":true,
67
+ "type":"string"
68
+ },
69
+ "team_id":{
70
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
71
+ "type":"string",
72
+ "maxLength": 22,
73
+ "minLength":22
74
+ },
75
+ "lock_version":{
76
+ "description": "Increased on every edit, so SK can detect/prevent a concurrent edit by another user. First save wins.",
77
+ "type":"integer"
78
+ }
79
+ },
80
+ "links":[
81
+ { "rel": "self",
82
+ "href": "products/{id}"
83
+ },
84
+ { "rel": "instances",
85
+ "href": "products",
86
+ "properties" : {
87
+ "page":{
88
+ "title" : "Page",
89
+ "description": "In paginated results set the page to look for",
90
+ "type":"number"
91
+ },
92
+ "per_page":{
93
+ "title" : "Per page",
94
+ "description": "Results per page. Default is 50, max is 200",
95
+ "type":"number"
96
+ },
97
+ "filter[q]":{
98
+ "title" : "Search",
99
+ "description": "Wildcard search in number, name, description, price",
100
+ "type":["string", "number"]
101
+ },
102
+ "filter[contact_ids]":{
103
+ "title" : "Contact IDs",
104
+ "description": "Comma-separated list of contact IDs. While present, it will return payments related to all contacts' documents.",
105
+ "type" : "string"
106
+ },
107
+ "filter[number]":{
108
+ "title" : "By number",
109
+ "description": "Search by exact number",
110
+ "type":"string"
111
+ },
112
+ "filter[tags]":{
113
+ "title" : "Tags",
114
+ "description": "Filter by a space delimited list of tags",
115
+ "type":"string"
116
+ },
117
+ "sort_by":{
118
+ "title" : "Sort by",
119
+ "description": "Sort the results by the given field => number",
120
+ "enum":["name","number","price", "created_at", "updated_at"],
121
+ "type": "string"
122
+ },
123
+ "sort":{
124
+ "title" : "Sort",
125
+ "enum":["ASC","DESC"],
126
+ "description": "Sort the results in ASC or DESC",
127
+ "type": "string"
128
+ }
129
+ }
130
+ },
131
+ { "rel": "destroy",
132
+ "href": "products/{id}",
133
+ "method": "DELETE"
134
+ },
135
+ { "rel": "update",
136
+ "href": "products/{id}",
137
+ "method": "PUT"
138
+ },
139
+ { "rel": "create",
140
+ "href": "products",
141
+ "method": "POST"
142
+ }
143
+ ]
144
+ }
@@ -0,0 +1,340 @@
1
+ { "type":"object",
2
+ "title": "recurring",
3
+ "name": "recurring",
4
+ "description": "An recurring is used as an template for new invoices.",
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 name to identify the document. Unlike all other document this one has no number schema and not auto assign",
16
+ "type":"string",
17
+ "required":true,
18
+ "maxLength": 50
19
+ },
20
+ "address_field":{
21
+ "description": "Receiver address, normally shown in envelope window. Defaults to client address_field if empty and client_id given.",
22
+ "type":"string"
23
+ },
24
+ "date":{
25
+ "description": "First date the recurring is issued. Not allowed to be in the past. YYYY-MM-DD",
26
+ "format":"date",
27
+ "type":"string",
28
+ "required":true
29
+ },
30
+ "due_days":{
31
+ "description": "Used to calculate the due date of the recurring. Useless if date and due date are present.",
32
+ "type":"integer"
33
+ },
34
+ "final_date":{
35
+ "description": "The last date the recurring is executed. YYYY-MM-DD",
36
+ "format":"date",
37
+ "type":"string",
38
+ "required":true
39
+ },
40
+ "frequency":{
41
+ "description": "Recurring frequency",
42
+ "enum":["yearly", "monthly", "weekly", "quarterly", "biweekly", "sixmonthly"],
43
+ "type":"string",
44
+ "required":true
45
+ },
46
+ "payment_method":{
47
+ "description": "How the document is being payed. Used in new payments.",
48
+ "enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"],
49
+ "type":"string"
50
+ },
51
+ "external_ref":{
52
+ "description": "Some external reference, whatever this may be.",
53
+ "type":"string",
54
+ "maxLength": 255
55
+ },
56
+ "title":{
57
+ "description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your recurring [number]'",
58
+ "type":"string",
59
+ "maxLength": 255
60
+ },
61
+ "notes_before":{
62
+ "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
63
+ "type":"string",
64
+ "format":"text"
65
+ },
66
+ "notes_after":{
67
+ "description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.",
68
+ "type":"string",
69
+ "format":"text"
70
+ },
71
+ "tag_list":{
72
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
73
+ "type":"string"
74
+ },
75
+ "language":{
76
+ "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.",
77
+ "type":"string",
78
+ "maxLength": 10
79
+ },
80
+ "currency":{
81
+ "description": "Currency code as defined by the ISO 4217 standard (3-letter UPCASE: EUR, USD)",
82
+ "type":"string",
83
+ "maxLength": 3,
84
+ "minLength": 3
85
+ },
86
+ "sepa_mandate_id":{
87
+ "description": "SEPA mandate identifier needed in direct debit transactions. This is a unique id given by you to the customer beforehand.",
88
+ "type":"string",
89
+ "maxLength": 35
90
+ },
91
+ "sepa_mandate_signed_at":{
92
+ "description": "Date the SEPA mandate was signed by your customer. Must not be in the future!",
93
+ "format":"date",
94
+ "type":"string"
95
+ },
96
+ "sepa_debit_sequence_type":{
97
+ "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.",
98
+ "type":"string",
99
+ "enum":["FRST","OOFF","RCUR","FNAL"]
100
+ },
101
+ "client":{
102
+ "description": "DEPRECATED: use contact",
103
+ "readonly":true,
104
+ "type":"object",
105
+ "properties":{"$ref":"./client.json#properties"}
106
+ },
107
+ "client_id":{
108
+ "description": "DEPRECATED: use contact_id",
109
+ "type":"string",
110
+ "maxLength": 22,
111
+ "minLength":22
112
+ },
113
+ "contact":{
114
+ "description": "The contact for the document. Use contact_id field to set a contact.",
115
+ "readonly":true,
116
+ "type":"object",
117
+ "properties":{"$ref":"./contact.json#properties"}
118
+ },
119
+ "contact_id":{
120
+ "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.",
121
+ "type":"string",
122
+ "maxLength": 22,
123
+ "minLength":22
124
+ },
125
+ "team_id":{
126
+ "description": "A team uuid taken from the contact. If set only the team and its parent teams can see the record.",
127
+ "readonly" :true,
128
+ "type":"string",
129
+ "maxLength": 22,
130
+ "minLength":22
131
+ },
132
+ "line_items":{
133
+ "description": "DEPRECATED use items",
134
+ "type":"array",
135
+ "properties":{"$ref":"./line_item.json#properties"}
136
+ },
137
+ "items":{
138
+ "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.",
139
+ "type":"array",
140
+ "default": "any",
141
+ "minItems": 0,
142
+ "items": [{ "$ref": "./line_item.json#properties"},
143
+ { "$ref": "./divider_item.json#properties"},
144
+ { "$ref": "./sub_total_item.json#properties"}]
145
+ },
146
+ "created_at":{
147
+ "description": "Date the object was created in SK. Never changes afterwards.",
148
+ "format":"date-time",
149
+ "readonly":true,
150
+ "type":"string"
151
+ },
152
+ "updated_at":{
153
+ "description": "Date the object was edited in SK.",
154
+ "format":"date-time",
155
+ "readonly":true,
156
+ "type":"string"
157
+ },
158
+ "lock_version":{
159
+ "description": "Auto-incremented to prevent concurrent updates. First save wins and increments version. ",
160
+ "type":"integer"
161
+ },
162
+ "gross_total":{
163
+ "description": "Gross total of all line items, 2 decimals places",
164
+ "readonly":true,
165
+ "type":"number"
166
+ },
167
+ "tax_total":{
168
+ "description": "Tax total, 2 decimals places",
169
+ "readonly":true,
170
+ "type":"number"
171
+ },
172
+ "net_total":{
173
+ "description": "Net total, 2 decimals places",
174
+ "readonly":true,
175
+ "type":"number"
176
+ },
177
+ "net_total_base":{
178
+ "description": "Net total, 6 decimal places incl. discount",
179
+ "readonly":true,
180
+ "type":"number"
181
+ },
182
+ "cost_total":{
183
+ "description": "Cost total of all line items, 2 decimals places in document currency.",
184
+ "readonly":true,
185
+ "type":"number"
186
+ },
187
+ "gross_margin_total":{
188
+ "description": "Total gross margin across all line items. Calculated from net_total-cost_total.",
189
+ "readonly":true,
190
+ "type":"number"
191
+ },
192
+ "gross_margin_pct":{
193
+ "description": "Percentage of gross profit to cost of items sold. Calculated from gross_margin_total/net_total*100",
194
+ "readonly":true,
195
+ "type":"number"
196
+ },
197
+ "pdf_template_id":{
198
+ "description": "The PDF template used for printing the invoice when auto sending. Required when auto_send'ing is enabled.",
199
+ "type":"string",
200
+ "maxLength": 22,
201
+ "minLength":22
202
+ },
203
+ "email_template_id":{
204
+ "description": "The Email template used for the email in auto sending. Required when auto_send'ing is enabled.",
205
+ "type":"string",
206
+ "maxLength": 22,
207
+ "minLength":22
208
+ },
209
+ "auto_send":{
210
+ "description": "Enable automatic sending of new invoices created from the recurring. Opens the invoice, creates a PDF and sends an email to the contact. GOTCHA's: check PDF-, Email-Template, SMTP Settings and of course the contacts email address! Since new recurrings which start today directly create new invoices, they are also SEND if auto_send is true!! If something fails, we'll send an error-email to the user who created the recurring. For success infos you can add yourself to the BCC of the email template or",
211
+ "default": null,
212
+ "type": "string",
213
+ "enum":["email"]
214
+ }
215
+ },
216
+ "links":[
217
+ { "rel": "self",
218
+ "href": "recurrings/{id}"
219
+ },
220
+ { "rel": "instances",
221
+ "href": "recurrings",
222
+ "properties" : {
223
+ "page":{
224
+ "title" : "Page",
225
+ "description": "In paginated results set the page to look for",
226
+ "type":"number"
227
+ },
228
+ "per_page":{
229
+ "title" : "Per page",
230
+ "description": "Results per page. Default is 50, max is 200",
231
+ "type":"number"
232
+ },
233
+ "filter[q]":{
234
+ "title" : "Search",
235
+ "description": "Search in title, number, address field",
236
+ "type":"string"
237
+ },
238
+ "filter[tags]":{
239
+ "title" : "Tags",
240
+ "description": "Filter by a space delimited list of tags",
241
+ "type":"string"
242
+ },
243
+ "filter[from]":{
244
+ "title" : "From date",
245
+ "description": "Objects with a date after the date. YYYY-MM-DD",
246
+ "format" : "date",
247
+ "type" : "string"
248
+ },
249
+ "filter[to]":{
250
+ "title" : "To date",
251
+ "description": "Objects with date before the date",
252
+ "format" : "date",
253
+ "type" : "string"
254
+ },
255
+ "filter[created_at_from]":{
256
+ "title" : "From date",
257
+ "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",
258
+ "format" : "date-time",
259
+ "type" : "string"
260
+ },
261
+ "filter[created_at_to]":{
262
+ "title" : "To date",
263
+ "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.",
264
+ "format" : "date-time",
265
+ "type" : "string"
266
+ },
267
+ "filter[languages]":{
268
+ "title" : "Languages",
269
+ "description": "A list of language codes, comma separated",
270
+ "type" : "string"
271
+ },
272
+ "filter[client_ids]":{
273
+ "title" : "Clients",
274
+ "description": "DEPRECATED use contact_ids",
275
+ "type" : "string"
276
+ },
277
+ "filter[contact_ids]":{
278
+ "title" : "Contacts",
279
+ "description": "Find objects belonging to a single or a list of contacts, use ids comma separated.",
280
+ "type" : "string"
281
+ },
282
+ "filter[ids]":{
283
+ "title" : "Documents",
284
+ "description": "A single or a list of document uuids, comma separated",
285
+ "type" : "string"
286
+ },
287
+ "filter[creator_ids]":{
288
+ "title" : "Creator",
289
+ "description": "Objects created by the given users uuids, comma separated",
290
+ "type" : "string"
291
+ },
292
+ "filter[product_ids]":{
293
+ "title" : "Products",
294
+ "description": "Documents using the given product uuids(comma separated) in their line items.",
295
+ "type" : "string"
296
+ },
297
+ "sort_by":{
298
+ "title" : "Sort by",
299
+ "description": "Sort the results by the given field => number",
300
+ "enum":["title", "number", "created_at", "updated_at", "price_total"],
301
+ "type": "string"
302
+ },
303
+ "sort":{
304
+ "title" : "Sort",
305
+ "enum":["ASC","DESC"],
306
+ "description": "Sort the results in ASC or DESC",
307
+ "type": "string"
308
+ }
309
+ }
310
+ },
311
+ { "rel": "destroy",
312
+ "href": "recurrings/{id}",
313
+ "method": "DELETE"
314
+ },
315
+ { "rel": "update",
316
+ "href": "recurrings/{id}",
317
+ "method": "PUT"
318
+ },
319
+ { "rel": "create",
320
+ "href": "recurrings",
321
+ "method": "POST",
322
+ "properties" : {
323
+ "source" : {
324
+ "title" : "Source document id",
325
+ "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.",
326
+ "type" : "string"
327
+ }
328
+ }
329
+ },
330
+ { "rel": "invoices",
331
+ "href": "invoices?filter[recurring_ids]={id}"
332
+ },
333
+ { "rel": "attachments",
334
+ "href": "recurrings/{id}/attachments"
335
+ },
336
+ { "rel": "comments",
337
+ "href": "recurrings/{id}/comments"
338
+ }
339
+ ]
340
+ }