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,85 @@
1
+ { "type":"object",
2
+ "title": "address",
3
+ "name": "address",
4
+ "description":"An address in SK is maintained within it's parent object(client, company). The first address(default_address) is used inside the address field of new documents. With multiple addresses sorting(first) is done by date, newest first. So if you add a new adddress it will be the new default one. See order and type property for details about ordering and accessing parcel work or home addresses.",
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
+ "city":{
15
+ "description": "City for the address. Must at least be present for an address.",
16
+ "required":true,
17
+ "type":"string",
18
+ "maxLength": 100
19
+ },
20
+ "address1":{
21
+ "description": "Should contain the street or otherwise primary address information.",
22
+ "type":"string",
23
+ "maxLength": 100
24
+ },
25
+ "address2":{
26
+ "description": "Additional address information, like floor number",
27
+ "type":"string",
28
+ "maxLength": 100
29
+ },
30
+ "pobox":{
31
+ "description": "Post office box number",
32
+ "type":"string",
33
+ "maxLength": 10
34
+ },
35
+ "zip":{
36
+ "description": "Zip number of the city. Length must be between 4..10",
37
+ "type":"string",
38
+ "maxLength": 10
39
+ },
40
+ "state":{
41
+ "description": "Country state of address",
42
+ "type":"string",
43
+ "maxLength": 100
44
+ },
45
+ "country":{
46
+ "description": "Country of the address.",
47
+ "type":"string",
48
+ "maxLength": 100
49
+ },
50
+ "created_at":{
51
+ "description": "Date the object was created in SK. Never changes afterwards",
52
+ "format":"date-time",
53
+ "readonly":true,
54
+ "type":"string"
55
+ },
56
+ "updated_at":{
57
+ "description": "Date the object was edited in SK.",
58
+ "format":"date-time",
59
+ "readonly":true,
60
+ "type":"string"
61
+ },
62
+ "address_type":{
63
+ "description": "Type of the address, as seen by vCard definition. There can only be one type. Inside of SK you can use placeholders like client.parcel_address.city to access the first parcel adr(Same for work_ / home_). <br/>Besides the placeholder default_address, always returns the first address found. Sorting is done by the order(if set) else by date, newest first.",
64
+ "enum":["work","home", "parcel"],
65
+ "type":"string"
66
+ },
67
+ "order":{
68
+ "description": "Addresses are normally sorted by date, newest first. If you need to strongly rely on their sorting e.g. default_address (always first) or have multiple addresses of one type(3 parcel), use this field for all adrs. <br/>Single adrs are used in placeholders like: addresses.2.city, returning the second adr found(not necessarily one with order=2).",
69
+ "type":"integer"
70
+ },
71
+ "lat":{
72
+ "description": "Geo-Location latitude",
73
+ "type":"number"
74
+ },
75
+ "long":{
76
+ "description": "Geo-Location longitude",
77
+ "type":"number"
78
+ },
79
+ "_destroy":{
80
+ "description": "When set an existing address will be deleted. This switch is only used when addresses are passed-in nested inside their parent object(a contact).",
81
+ "type":"boolean"
82
+ }
83
+ },
84
+ "links":[]
85
+ }
@@ -0,0 +1,133 @@
1
+ { "type":"object",
2
+ "title": "attachment",
3
+ "name": "attachment",
4
+ "description":"An file attachment",
5
+ "properties":{
6
+ "id":{
7
+ "description": "uuid of the object.",
8
+ "identity":true,
9
+ "readonly":true,
10
+ "type":"string",
11
+ "maxLength": 22,
12
+ "minLength":22
13
+ },
14
+ "filename":{
15
+ "description": "The filename as set when uploaded",
16
+ "readonly":true,
17
+ "type":"string",
18
+ "maxLength": 255
19
+ },
20
+ "disk_filename":{
21
+ "description": "Unique filename set by SK",
22
+ "readonly":true,
23
+ "type":"string",
24
+ "maxLength": 255
25
+ },
26
+ "url":{
27
+ "description": "DEPRECATED use attachments/ID/download",
28
+ "readonly":true,
29
+ "type":"string",
30
+ "format": "uri"
31
+ },
32
+ "related_object_type":{
33
+ "description": "Object type of the attachment parent. A base class name: Document(for invoice, credit_note) Contact, Message(for email), Template(for email, pdf template)",
34
+ "required":true,
35
+ "type":"string"
36
+ },
37
+ "related_object_id":{
38
+ "description": "uuid of the attachment parent object.",
39
+ "required":true,
40
+ "type":"string",
41
+ "maxLength": 22,
42
+ "minLength":22
43
+ },
44
+ "content_type":{
45
+ "description": "Auto detected on upload. Might not always reflect the real content type",
46
+ "readonly":true,
47
+ "type":"string"
48
+ },
49
+ "size":{
50
+ "description": "Filesize in kb. Auto detected on upload.",
51
+ "readonly":true,
52
+ "type":"integer"
53
+ },
54
+ "is_signed":{
55
+ "description": "True if the file(pdf) has been digitally signed.",
56
+ "type":"boolean"
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
+ "team_id":{
65
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
66
+ "type":"string",
67
+ "maxLength": 22,
68
+ "minLength":22
69
+ }
70
+
71
+ },
72
+ "links":[
73
+ { "rel": "self",
74
+ "href": "attachments/{id}"
75
+ },
76
+ { "rel": "download",
77
+ "href": "attachments/{id}/download"
78
+ },
79
+ { "rel": "instances",
80
+ "href": "attachments",
81
+ "properties" : {
82
+ "page":{
83
+ "title" : "Page",
84
+ "description": "In paginated results set the page to look for",
85
+ "type":"number"
86
+ },
87
+ "per_page":{
88
+ "title" : "Per page",
89
+ "description": "Results per page. Default is 50, max is 200",
90
+ "type":"number"
91
+ },
92
+ "filter[q]":{
93
+ "title" : "Search",
94
+ "description": "Search in filename",
95
+ "type":"string"
96
+ },
97
+ "filter[from]":{
98
+ "title" : "From date",
99
+ "description": "All objects created at and after the date",
100
+ "format" : "date",
101
+ "type" : "string"
102
+ },
103
+ "filter[to]":{
104
+ "title" : "To date",
105
+ "description": "All objects created at and before the date. YYYY-MM-DD",
106
+ "format" : "date",
107
+ "type" : "string"
108
+ },
109
+ "filter[related_object_type]":{
110
+ "title" : "Related object type",
111
+ "description": "All objects belonging to the given object type. The singular base class name like: Document, Contact, Export, Message",
112
+ "type" : "string"
113
+ },
114
+ "sort_by":{
115
+ "title" : "Sort by",
116
+ "description": "Sort the results by the given field",
117
+ "enum":["filename","related_object_id","related_object_type", "created_at"],
118
+ "type": "string"
119
+ },
120
+ "sort":{
121
+ "title" : "Sort",
122
+ "enum":["ASC","DESC"],
123
+ "description": "Sort the results in ASC or DESC",
124
+ "type": "string"
125
+ }
126
+ }
127
+ },
128
+ { "rel": "destroy",
129
+ "href": "attachments/{id}",
130
+ "method": "DELETE"
131
+ }
132
+ ]
133
+ }
@@ -0,0 +1,75 @@
1
+ {"type":"object",
2
+ "title": "auth_permission",
3
+ "name": "auth_permission",
4
+ "description": "A Permission authorises someone to execute actions(grants privileges) in the scope of a context. The context is a resource f.ex: clients, and the privileges a group of actions like: index, show, edit, update. A permission to read invoices has the context: invoices and as privileges: index,show.",
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
+ "full_name":{
15
+ "description": "Context_name and name localized: API Clients read - API Kunden anzeigen",
16
+ "type":"string",
17
+ "maxLength": 255
18
+ },
19
+ "name":{
20
+ "description": "Name for the permission. Since a permission groups multiple privileges the name reflects what someone is allowed to do: read, update, delete. With 'read' granting acccess to the 'index' and 'show' actions of a resource.",
21
+ "type":"string",
22
+ "maxLength": 255
23
+ },
24
+ "context_name":{
25
+ "description": "The context for the permission, being a resource: clients, emails",
26
+ "readonly":true,
27
+ "type":"string",
28
+ "maxLength": 255
29
+ },
30
+ "privilege_list":{
31
+ "description": "A permission has many privileges which define the actions someone can execute. Such actions are resource methods like index, update, edit, show",
32
+ "type":"string",
33
+ "readonly":true,
34
+ "maxLength": 255
35
+ }
36
+ },
37
+
38
+ "links":[
39
+ { "rel": "instances",
40
+ "href": "auth_permissions",
41
+ "properties" : {
42
+ "page":{
43
+ "title" : "Page",
44
+ "description": "In paginated results set the page to look for",
45
+ "type":"number"
46
+ },
47
+ "per_page":{
48
+ "title" : "Per page",
49
+ "description": "Results per page. Default is 50, max is 200",
50
+ "type":"number"
51
+ },
52
+ "filter[q]":{
53
+ "title" : "Search",
54
+ "description": "Search in name and context names",
55
+ "type":"string"
56
+ },
57
+ "sort_by":{
58
+ "title" : "Sort by",
59
+ "description": "Sort the results by the given field => number",
60
+ "enum":["auth_permission.name", "auth_context.name"],
61
+ "type": "string"
62
+ },
63
+ "sort":{
64
+ "title" : "Sort",
65
+ "enum":["ASC","DESC"],
66
+ "description": "Sort the results in ASC or DESC",
67
+ "type": "string"
68
+ }
69
+ }
70
+ },
71
+ { "rel": "self",
72
+ "href": "auth_permissions/{id}"
73
+ }
74
+ ]
75
+ }
@@ -0,0 +1,318 @@
1
+ {"type":"object",
2
+ "title": "client",
3
+ "name": "client",
4
+ "description": "A client as seen by SalesKing. This resource is DEPRECATED please use contacts instead with type-field set 'Client'",
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, auto-created by SK for new client without number.",
16
+ "type":"string",
17
+ "maxLength": 50
18
+ },
19
+ "organisation":{
20
+ "description": "Name of a company. This or lastname must be present",
21
+ "required" : true,
22
+ "type":"string",
23
+ "maxLength": 100
24
+ },
25
+ "last_name":{
26
+ "description": "Last name of a person. At least this or the organisation field must be filled for new records",
27
+ "type":"string",
28
+ "maxLength": 50
29
+ },
30
+ "first_name":{
31
+ "description": "First name of a person.",
32
+ "type":"string",
33
+ "maxLength": 50
34
+ },
35
+ "gender":{
36
+ "description": "Can be empty for a company. Is used in salutation",
37
+ "enum":["male", "female"],
38
+ "type":"string"
39
+ },
40
+ "notes":{
41
+ "description": "Notes for a contact. For day to day information you should use comments instead.",
42
+ "type":"string",
43
+ "format": "text"
44
+ },
45
+ "position":{
46
+ "description": "Position of a person in a company.",
47
+ "type":"string",
48
+ "maxLength": 50
49
+ },
50
+ "title":{
51
+ "description": "Academical title of a person e.g. Dr., Prof",
52
+ "type":"string",
53
+ "maxLength": 50
54
+ },
55
+ "tax_number":{
56
+ "description": "Tax number, normally applies to a private person",
57
+ "type":"string",
58
+ "maxLength": 30
59
+ },
60
+ "vat_number":{
61
+ "description": "VAT number, for a company or person paying value added taxes.",
62
+ "type":"string",
63
+ "maxLength": 30
64
+ },
65
+ "email":{
66
+ "description": "Email address of the contact.",
67
+ "type":"string",
68
+ "maxLength": 100
69
+ },
70
+ "url":{
71
+ "description": "An url associated with the person, e.g its company website.",
72
+ "type":"string",
73
+ "maxLength": 255
74
+ },
75
+ "birthday":{
76
+ "description": "The birthday. YYYY-MM-DD",
77
+ "format":"date",
78
+ "type":"string"
79
+ },
80
+ "tag_list":{
81
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
82
+ "type":"string"
83
+ },
84
+ "created_at":{
85
+ "description": "Date the record was created in SK. Never changes afterwards.",
86
+ "format":"date-time",
87
+ "readonly":true,
88
+ "type":"string"
89
+ },
90
+ "updated_at":{
91
+ "description": "Last date when the record was edited.",
92
+ "format":"date-time",
93
+ "readonly":true,
94
+ "type":"string"
95
+ },
96
+ "language":{
97
+ "description": "Should be a valid language short-code: de-DE, fr, en-GB; like defined in your account language menu. When the client is emailed, a localized version of a multi-language template(email, pdf) will be used if available. The language will also be set for new documents.",
98
+ "type":"string",
99
+ "maxLength": 10
100
+ },
101
+ "currency":{
102
+ "description": "Currency code as defined by the ISO 4217 standard(3-letter UPCASE: EUR, USD). If set the currency is taken for new documents.",
103
+ "type":"string",
104
+ "maxLength": 3,
105
+ "minLength": 3
106
+ },
107
+ "payment_method":{
108
+ "description": "Default payment method for used for new documemts",
109
+ "enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"],
110
+ "type":"string"
111
+ },
112
+ "bank_name":{
113
+ "description": "Bank name",
114
+ "type":"string",
115
+ "maxLength": 70
116
+ },
117
+ "bank_number":{
118
+ "description": "Bank number",
119
+ "type":"string",
120
+ "maxLength": 35
121
+ },
122
+ "bank_account_number":{
123
+ "description": "Bank account number.",
124
+ "type":"string",
125
+ "maxLength": 35
126
+ },
127
+ "bank_iban":{
128
+ "description": "IBAN Number of the bank account. Is validated",
129
+ "type":"string",
130
+ "maxLength": 35
131
+ },
132
+ "bank_swift":{
133
+ "description": "SWIFT BIC- Bank Identifier Code",
134
+ "type":"string",
135
+ "maxLength": 11
136
+ },
137
+ "bank_owner":{
138
+ "description": "Bank account owner",
139
+ "type":"string",
140
+ "maxLength": 70
141
+ },
142
+ "phone_fax":{
143
+ "description": "Fax number",
144
+ "type":"string",
145
+ "maxLength": 30
146
+ },
147
+ "phone_office":{
148
+ "description": "Office phone number",
149
+ "type":"string",
150
+ "maxLength": 30
151
+ },
152
+ "phone_home":{
153
+ "description": "Private phone number",
154
+ "type":"string",
155
+ "maxLength": 30
156
+ },
157
+ "phone_mobile":{
158
+ "description": "Mobile phone number",
159
+ "type":"string",
160
+ "maxLength": 30
161
+ },
162
+ "lock_version":{
163
+ "description": "Increased on every edit, so SK can detect/prevent a concurrent edit by another user. First save wins.",
164
+ "type":"integer"
165
+ },
166
+ "cash_discount":{
167
+ "description": "Default cash discount for new invoices.",
168
+ "type":"number"
169
+ },
170
+ "due_days":{
171
+ "description": "Default due days for new invoices.",
172
+ "type":"integer"
173
+ },
174
+ "address_field":{
175
+ "description": "Returns the address field used on new docs. Consist of Organisation name and default(first) address",
176
+ "readonly":true,
177
+ "type":"string"
178
+ },
179
+ "addresses":{
180
+ "description": "A client can have many addresses, sorted by date descending(new first). Default address is the most recent one.",
181
+ "type":"array",
182
+ "properties" : {"$ref":"./address.json#properties"}
183
+ },
184
+ "team_id":{
185
+ "description": "A team uuid. If set only the team and its parent teams can see the record.",
186
+ "type":"string",
187
+ "maxLength": 22,
188
+ "minLength":22
189
+ }
190
+ },
191
+ "links":[
192
+ { "rel": "self",
193
+ "href": "clients/{id}"
194
+ },
195
+ { "rel": "instances",
196
+ "href": "clients",
197
+ "properties" : {
198
+ "page":{
199
+ "title" : "Page",
200
+ "description": "In paginated results set the page to look for",
201
+ "type":"number"
202
+ },
203
+ "per_page":{
204
+ "title" : "Per page",
205
+ "description": "Results per page. Default is 50, max is 200",
206
+ "type":"number"
207
+ },
208
+ "filter[q]":{
209
+ "title" : "Search",
210
+ "description": "Wildcard search in first, last_name, organisation, email, number",
211
+ "type":"string"
212
+ },
213
+ "filter[tags]":{
214
+ "title" : "Tags",
215
+ "description": "Filter by a space delimited list of tags",
216
+ "type":"string"
217
+ },
218
+ "filter[ids]":{
219
+ "title" : "Clients",
220
+ "description": "A single or a list of client uuids, comma separated",
221
+ "type" : "string"
222
+ },
223
+ "filter[created_at_from]":{
224
+ "title" : "From date",
225
+ "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",
226
+ "format" : "date-time",
227
+ "type" : "string"
228
+ },
229
+ "filter[created_at_to]":{
230
+ "title" : "To date",
231
+ "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.",
232
+ "format" : "date-time",
233
+ "type" : "string"
234
+ },
235
+ "filter[birthday_from]":{
236
+ "title" : "From birthday date",
237
+ "description": "Contacts with a birthday after and on the date. Leave the birthday-to date blank to only search on this day. YYYY-MM-DD",
238
+ "format" : "date",
239
+ "type" : "string"
240
+ },
241
+ "filter[birthday_to]":{
242
+ "title" : "To birthday date",
243
+ "description": "Contacts with a birthday date before and on the date. YYYY-MM-DD",
244
+ "format" : "date",
245
+ "type" : "string"
246
+ },
247
+ "filter[creator_ids]":{
248
+ "title" : "Creator",
249
+ "description": "Objects created by the given users uuids, comma separated",
250
+ "type" : "string"
251
+ },
252
+ "filter[number]":{
253
+ "title" : "By number",
254
+ "description": "Search by number where the number is matched from the start: number%",
255
+ "type" : "string"
256
+ },
257
+ "filter[languages]":{
258
+ "title" : "Languages",
259
+ "description": "A single or a list of language codes, comma separated",
260
+ "type" : "string"
261
+ },
262
+ "sort_by":{
263
+ "title" : "Sort by",
264
+ "description": "Sort the results by the given field => number",
265
+ "enum":["organisation", "number","email","first_name","last_name", "created_at", "updated_at"],
266
+ "type": "string"
267
+ },
268
+ "sort":{
269
+ "title" : "Sort",
270
+ "enum":["ASC","DESC"],
271
+ "description": "Sort the results in ASC or DESC"
272
+ }
273
+ }
274
+ },
275
+ { "rel": "destroy",
276
+ "href": "clients/{id}",
277
+ "method": "DELETE"
278
+ },
279
+ { "rel": "update",
280
+ "href": "clients/{id}",
281
+ "method": "PUT"
282
+ },
283
+ { "rel": "create",
284
+ "href": "clients",
285
+ "method": "POST"
286
+ },
287
+ { "rel": "documents",
288
+ "href": "clients/{id}/documents"
289
+ },
290
+ { "rel": "attachments",
291
+ "href": "clients/{id}/attachments"
292
+ },
293
+ { "rel": "invoices",
294
+ "href": "clients/{id}/invoices"
295
+ },
296
+ { "rel": "estimates",
297
+ "href": "clients/{id}/estimates"
298
+ },
299
+ { "rel": "orders",
300
+ "href": "clients/{id}/orders"
301
+ },
302
+ { "rel": "credit_notes",
303
+ "href": "clients/{id}/credit_notes"
304
+ },
305
+ { "rel": "recurrings",
306
+ "href": "clients/{id}/recurrings"
307
+ },
308
+ { "rel": "payment_reminders",
309
+ "href": "clients/{id}/payment_reminders"
310
+ },
311
+ { "rel": "comments",
312
+ "href": "clients/{id}/comments"
313
+ },
314
+ { "rel": "emails",
315
+ "href": "clients/{id}/emails"
316
+ }
317
+ ]
318
+ }