sk_api_schema 0.10.6 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +6 -2
- data/CHANGELOG.md +4 -0
- data/README.rdoc +1 -1
- data/Rakefile +0 -10
- data/json/v1.0/account.json +13 -0
- data/json/v1.0/contact.json +7 -1
- data/json/v1.0/credit_note.json +6 -0
- data/json/v1.0/invoice.json +6 -0
- data/json/v1.0/order.json +6 -0
- data/json/v1.0/product.json +0 -4
- data/json/v1.0/recurring.json +6 -0
- data/json/v2.0/README.md +28 -0
- data/json/v2.0/account.json +31 -18
- data/json/v2.0/account_billing.json +15 -7
- data/json/v2.0/account_entry.json +19 -16
- data/json/v2.0/address.json +7 -6
- data/json/v2.0/attachment.json +17 -16
- data/json/v2.0/auth_permission.json +6 -5
- data/json/v2.0/comment.json +15 -9
- data/json/v2.0/company.json +11 -8
- data/json/v2.0/contact.json +45 -49
- data/json/v2.0/credit_note.json +59 -84
- data/json/v2.0/divider_item.json +9 -8
- data/json/v2.0/document.json +41 -36
- data/json/v2.0/email.json +29 -22
- data/json/v2.0/email_template.json +15 -10
- data/json/v2.0/estimate.json +59 -76
- data/json/v2.0/export.json +26 -16
- data/json/v2.0/export_template.json +15 -9
- data/json/v2.0/invoice.json +62 -92
- data/json/v2.0/language.json +14 -6
- data/json/v2.0/line_item.json +14 -13
- data/json/v2.0/order.json +59 -75
- data/json/v2.0/payment.json +17 -12
- data/json/v2.0/payment_reminder.json +53 -71
- data/json/v2.0/pdf_template.json +14 -8
- data/json/v2.0/product.json +16 -13
- data/json/v2.0/recurring.json +57 -54
- data/json/v2.0/sub.json +14 -7
- data/json/v2.0/sub_total_item.json +10 -9
- data/json/v2.0/tag.json +13 -5
- data/json/v2.0/task.json +31 -16
- data/json/v2.0/text_template.json +16 -10
- data/json/v2.0/user.json +8 -8
- data/lib/sk_api_schema/version.rb +1 -1
- data/sk_api_schema.gemspec +1 -1
- data/spec/sk_api_schema_spec.rb +35 -19
- data/spec/spec_helper.rb +1 -2
- metadata +7 -7
- data/json/v2.0/client.json +0 -318
data/json/v2.0/address.json
CHANGED
@@ -1,19 +1,20 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type":"object",
|
2
4
|
"title": "address",
|
3
|
-
"name": "address",
|
4
5
|
"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.",
|
6
|
+
"required": ["city"],
|
5
7
|
"properties":{
|
6
8
|
"id":{
|
7
9
|
"description":"Unique identifier - UUID",
|
8
10
|
"identity":true,
|
9
|
-
"
|
11
|
+
"readOnly":true,
|
10
12
|
"type":"string",
|
11
13
|
"maxLength": 22,
|
12
14
|
"minLength":22
|
13
15
|
},
|
14
16
|
"city":{
|
15
17
|
"description": "City for the address. Must at least be present for an address.",
|
16
|
-
"required":true,
|
17
18
|
"type":"string",
|
18
19
|
"maxLength": 100
|
19
20
|
},
|
@@ -50,13 +51,13 @@
|
|
50
51
|
"created_at":{
|
51
52
|
"description": "Date the object was created in SK. Never changes afterwards",
|
52
53
|
"format":"date-time",
|
53
|
-
"
|
54
|
+
"readOnly":true,
|
54
55
|
"type":"string"
|
55
56
|
},
|
56
57
|
"updated_at":{
|
57
58
|
"description": "Date the object was edited in SK.",
|
58
59
|
"format":"date-time",
|
59
|
-
"
|
60
|
+
"readOnly":true,
|
60
61
|
"type":"string"
|
61
62
|
},
|
62
63
|
"address_type":{
|
data/json/v2.0/attachment.json
CHANGED
@@ -1,54 +1,55 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type":"object",
|
2
4
|
"title": "attachment",
|
3
|
-
"name": "attachment",
|
4
5
|
"description":"An file attachment",
|
6
|
+
"required": ["related_object_type", "related_object_id"],
|
5
7
|
"properties":{
|
6
8
|
"id":{
|
7
9
|
"description": "uuid of the object.",
|
8
10
|
"identity":true,
|
9
|
-
"
|
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
|
"filename":{
|
15
24
|
"description": "The filename as set when uploaded",
|
16
|
-
"
|
25
|
+
"readOnly":true,
|
17
26
|
"type":"string",
|
18
27
|
"maxLength": 255
|
19
28
|
},
|
20
29
|
"disk_filename":{
|
21
30
|
"description": "Unique filename set by SK",
|
22
|
-
"
|
31
|
+
"readOnly":true,
|
23
32
|
"type":"string",
|
24
33
|
"maxLength": 255
|
25
34
|
},
|
26
|
-
"url":{
|
27
|
-
"description": "DEPRECATED use attachments/ID/download",
|
28
|
-
"readonly":true,
|
29
|
-
"type":"string",
|
30
|
-
"format": "uri"
|
31
|
-
},
|
32
35
|
"related_object_type":{
|
33
36
|
"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
37
|
"type":"string"
|
36
38
|
},
|
37
39
|
"related_object_id":{
|
38
40
|
"description": "uuid of the attachment parent object.",
|
39
|
-
"required":true,
|
40
41
|
"type":"string",
|
41
42
|
"maxLength": 22,
|
42
43
|
"minLength":22
|
43
44
|
},
|
44
45
|
"content_type":{
|
45
46
|
"description": "Auto detected on upload. Might not always reflect the real content type",
|
46
|
-
"
|
47
|
+
"readOnly":true,
|
47
48
|
"type":"string"
|
48
49
|
},
|
49
50
|
"size":{
|
50
51
|
"description": "Filesize in kb. Auto detected on upload.",
|
51
|
-
"
|
52
|
+
"readOnly":true,
|
52
53
|
"type":"integer"
|
53
54
|
},
|
54
55
|
"is_signed":{
|
@@ -58,7 +59,7 @@
|
|
58
59
|
"created_at":{
|
59
60
|
"description": "Date the object was created in SK. Never changes afterwards",
|
60
61
|
"format":"date-time",
|
61
|
-
"
|
62
|
+
"readOnly":true,
|
62
63
|
"type":"string"
|
63
64
|
},
|
64
65
|
"team_id":{
|
@@ -1,12 +1,13 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type":"object",
|
2
4
|
"title": "auth_permission",
|
3
|
-
"name": "auth_permission",
|
4
5
|
"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
6
|
"properties":{
|
6
7
|
"id":{
|
7
8
|
"description":"Unique identifier - UUID",
|
8
9
|
"identity":true,
|
9
|
-
"
|
10
|
+
"readOnly":true,
|
10
11
|
"type":"string",
|
11
12
|
"maxLength": 22,
|
12
13
|
"minLength":22
|
@@ -23,14 +24,14 @@
|
|
23
24
|
},
|
24
25
|
"context_name":{
|
25
26
|
"description": "The context for the permission, being a resource: clients, emails",
|
26
|
-
"
|
27
|
+
"readOnly":true,
|
27
28
|
"type":"string",
|
28
29
|
"maxLength": 255
|
29
30
|
},
|
30
31
|
"privilege_list":{
|
31
32
|
"description": "A permission has many privileges which define the actions someone can execute. Such actions are resource methods like index, update, edit, show",
|
32
33
|
"type":"string",
|
33
|
-
"
|
34
|
+
"readOnly":true,
|
34
35
|
"maxLength": 255
|
35
36
|
}
|
36
37
|
},
|
data/json/v2.0/comment.json
CHANGED
@@ -1,29 +1,35 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type":"object",
|
2
4
|
"title": "comment",
|
3
|
-
"name": "comment",
|
4
5
|
"description":"An comment in SK must always be related to an object.",
|
6
|
+
"required": ["related_object_type", "related_object_id", "text"],
|
5
7
|
"properties":{
|
6
8
|
"id":{
|
7
9
|
"description":"Unique identifier - UUID",
|
8
10
|
"identity":true,
|
9
|
-
"
|
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
|
"text":{
|
15
24
|
"description": "The comment himself.",
|
16
|
-
"required":true,
|
17
25
|
"type":"string"
|
18
26
|
},
|
19
27
|
"related_object_type":{
|
20
28
|
"description": "Object type of the comments parent. Is the camelcased base class name: Document for invoice, credit_note, contact",
|
21
|
-
"required":true,
|
22
29
|
"type":"string"
|
23
30
|
},
|
24
31
|
"related_object_id":{
|
25
32
|
"description": "uuid of the comments parent object.",
|
26
|
-
"required":true,
|
27
33
|
"type":"string",
|
28
34
|
"maxLength": 22,
|
29
35
|
"minLength":22
|
@@ -31,18 +37,18 @@
|
|
31
37
|
"created_at":{
|
32
38
|
"description": "Date the object was created in SK. Never changes afterwards",
|
33
39
|
"format":"date-time",
|
34
|
-
"
|
40
|
+
"readOnly":true,
|
35
41
|
"type":"string"
|
36
42
|
},
|
37
43
|
"updated_at":{
|
38
44
|
"description": "Date the object was edited in SK.",
|
39
45
|
"format":"date-time",
|
40
|
-
"
|
46
|
+
"readOnly":true,
|
41
47
|
"type":"string"
|
42
48
|
},
|
43
49
|
"team_id":{
|
44
50
|
"description": "A team uuid taken from the related object. If set only the team and its parent teams can see the record.",
|
45
|
-
"
|
51
|
+
"readOnly" :true,
|
46
52
|
"type":"string",
|
47
53
|
"maxLength": 22,
|
48
54
|
"minLength":22
|
data/json/v2.0/company.json
CHANGED
@@ -1,12 +1,13 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type":"object",
|
2
4
|
"title": "company",
|
3
|
-
"name": "company",
|
4
5
|
"description": "A company is the main entity, so any data belongs to a company. It is identified by the current subdomain and cannot be edited via API atm",
|
5
6
|
"properties":{
|
6
7
|
"id":{
|
7
8
|
"description":"Unique identifier - UUID",
|
8
9
|
"identity":true,
|
9
|
-
"
|
10
|
+
"readOnly":true,
|
10
11
|
"type":"string",
|
11
12
|
"maxLength": 22,
|
12
13
|
"minLength":22
|
@@ -36,7 +37,7 @@
|
|
36
37
|
"description": "Link to a company's SalesKing account.",
|
37
38
|
"type":"string",
|
38
39
|
"format":"uri",
|
39
|
-
"
|
40
|
+
"readOnly":true
|
40
41
|
},
|
41
42
|
"time_zone":{
|
42
43
|
"description": "Default time zone, used for new users",
|
@@ -45,7 +46,6 @@
|
|
45
46
|
},
|
46
47
|
"email":{
|
47
48
|
"description": "Email address",
|
48
|
-
"required":true,
|
49
49
|
"type":"string",
|
50
50
|
"maxLength": 100
|
51
51
|
},
|
@@ -77,7 +77,10 @@
|
|
77
77
|
"addresses":{
|
78
78
|
"description": "A company can have many addresses, sorted by date descending(new first). Default address used in placeholder is the most recent one.",
|
79
79
|
"type":"array",
|
80
|
-
"
|
80
|
+
"items": {
|
81
|
+
"type": "object",
|
82
|
+
"$ref": "./address.json#"
|
83
|
+
}
|
81
84
|
},
|
82
85
|
"vat_number":{
|
83
86
|
"description": "VAT number, for a company entitled to pay value added taxes.",
|
@@ -122,13 +125,13 @@
|
|
122
125
|
"created_at":{
|
123
126
|
"description": "Date the record was created in SK. Never changes afterwards.",
|
124
127
|
"format":"date-time",
|
125
|
-
"
|
128
|
+
"readOnly":true,
|
126
129
|
"type":"string"
|
127
130
|
},
|
128
131
|
"updated_at":{
|
129
132
|
"description": "Last date when the record was edited.",
|
130
133
|
"format":"date-time",
|
131
|
-
"
|
134
|
+
"readOnly":true,
|
132
135
|
"type":"string"
|
133
136
|
}
|
134
137
|
},
|
data/json/v2.0/contact.json
CHANGED
@@ -1,12 +1,21 @@
|
|
1
|
-
{
|
1
|
+
{
|
2
|
+
"$schema": "http://json-schema.org/draft-04/schema#",
|
3
|
+
"type":"object",
|
2
4
|
"title": "contact",
|
3
|
-
"
|
4
|
-
"
|
5
|
+
"description": "A contact can be a lead, client or supplier, depending on its type field. Use the filter[type] parameter to show only contacts of a kind.",
|
6
|
+
"required" : ["type"],
|
5
7
|
"properties":{
|
6
8
|
"id":{
|
7
9
|
"description":"Unique identifier - UUID",
|
8
10
|
"identity":true,
|
9
|
-
"
|
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
|
@@ -20,9 +29,8 @@
|
|
20
29
|
"type":{
|
21
30
|
"description": "Type of contact",
|
22
31
|
"enum":["Client", "Lead", "Supplier"],
|
23
|
-
"required" : true,
|
24
32
|
"type":"string",
|
25
|
-
"
|
33
|
+
"default":"Lead"
|
26
34
|
},
|
27
35
|
"is_employee":{
|
28
36
|
"description": "An employee gets number, organisation, tax and vat_number from its parent. If you set any of these, they are overwritten. When changing a parent-contact the fields on his direct child-employees are updated too.",
|
@@ -30,18 +38,17 @@
|
|
30
38
|
"default": false
|
31
39
|
},
|
32
40
|
"number":{
|
33
|
-
"description": "Unique number, auto-
|
41
|
+
"description": "Unique number, auto-set, if empty, for new Client and Suppliers from SK's contact number schema.",
|
34
42
|
"type":"string",
|
35
43
|
"maxLength": 50
|
36
44
|
},
|
37
45
|
"organisation":{
|
38
|
-
"description": "Name of a company. This or lastname
|
39
|
-
"required" : true,
|
46
|
+
"description": "Name of a company. This or lastname MUST be present",
|
40
47
|
"type":"string",
|
41
48
|
"maxLength": 100
|
42
49
|
},
|
43
50
|
"last_name":{
|
44
|
-
"description": "Last name of a person.
|
51
|
+
"description": "Last name of a person. This or the organisation field must be present for new records",
|
45
52
|
"type":"string",
|
46
53
|
"maxLength": 50
|
47
54
|
},
|
@@ -58,7 +65,7 @@
|
|
58
65
|
"notes":{
|
59
66
|
"description": "Notes for a contact. For day to day information you should use comments instead.",
|
60
67
|
"type":"string",
|
61
|
-
"format": "
|
68
|
+
"format": "string"
|
62
69
|
},
|
63
70
|
"position":{
|
64
71
|
"description": "Position of a person in a company.",
|
@@ -102,13 +109,13 @@
|
|
102
109
|
"created_at":{
|
103
110
|
"description": "Date the record was created in SK. Never changes afterwards.",
|
104
111
|
"format":"date-time",
|
105
|
-
"
|
112
|
+
"readOnly":true,
|
106
113
|
"type":"string"
|
107
114
|
},
|
108
115
|
"updated_at":{
|
109
116
|
"description": "Last date when the record was edited.",
|
110
117
|
"format":"date-time",
|
111
|
-
"
|
118
|
+
"readOnly":true,
|
112
119
|
"type":"string"
|
113
120
|
},
|
114
121
|
"language":{
|
@@ -179,6 +186,7 @@
|
|
179
186
|
},
|
180
187
|
"lock_version":{
|
181
188
|
"description": "Increased on every edit, so SK can detect/prevent a concurrent edit by another user. First save wins.",
|
189
|
+
"readOnly":true,
|
182
190
|
"type":"integer"
|
183
191
|
},
|
184
192
|
"cash_discount":{
|
@@ -186,18 +194,21 @@
|
|
186
194
|
"type":"number"
|
187
195
|
},
|
188
196
|
"due_days":{
|
189
|
-
"description": "Default due days for new
|
197
|
+
"description": "Default due days for new documents.",
|
190
198
|
"type":"integer"
|
191
199
|
},
|
192
200
|
"address_field":{
|
193
201
|
"description": "Returns the address field used on new docs. Consist of Organisation name and default(first) address",
|
194
|
-
"
|
202
|
+
"readOnly":true,
|
195
203
|
"type":"string"
|
196
204
|
},
|
197
205
|
"addresses":{
|
198
206
|
"description": "A client can have many addresses, sorted by date descending(new first). Default address is the most recent one.",
|
199
|
-
"type":"array",
|
200
|
-
"
|
207
|
+
"type": "array",
|
208
|
+
"items": {
|
209
|
+
"type": "object",
|
210
|
+
"$ref" : "./address.json#"
|
211
|
+
}
|
201
212
|
},
|
202
213
|
"team_id":{
|
203
214
|
"description": "A team uuid. If set only the team and its parent teams can see the record. The team is set for all new documents and related objects like comments, attachments, emails. When changed ALL related objects are updated with the new team!!",
|
@@ -233,8 +244,14 @@
|
|
233
244
|
},
|
234
245
|
"expected_revenue":{
|
235
246
|
"description": "Product of the probability and sales potential. e.g how much of the sales_potential can we get?",
|
236
|
-
"
|
247
|
+
"readOnly":true,
|
237
248
|
"type":"number"
|
249
|
+
},
|
250
|
+
"tax_exemption_id":{
|
251
|
+
"description": "ID of a tax exemption. New documents inherit the tax exemption and will be created without any taxes.",
|
252
|
+
"type":"string",
|
253
|
+
"maxLength": 22,
|
254
|
+
"minLength":22
|
238
255
|
}
|
239
256
|
},
|
240
257
|
"links":[
|
@@ -364,55 +381,34 @@
|
|
364
381
|
"method": "POST"
|
365
382
|
},
|
366
383
|
{ "rel": "documents",
|
367
|
-
"href": "
|
384
|
+
"href": "documents?filter[contact_ids]={id}"
|
368
385
|
},
|
369
386
|
{ "rel": "attachments",
|
370
|
-
"href": "
|
387
|
+
"href": "attachments?filter[related_object_ids]={id}"
|
371
388
|
},
|
372
389
|
{ "rel": "invoices",
|
373
|
-
"href": "
|
390
|
+
"href": "invoices?filter[contact_ids]={id}"
|
374
391
|
},
|
375
392
|
{ "rel": "estimates",
|
376
|
-
"href": "
|
393
|
+
"href": "estimates?filter[contact_ids]={id}"
|
377
394
|
},
|
378
395
|
{ "rel": "orders",
|
379
|
-
"href": "
|
396
|
+
"href": "orders?filter[contact_ids]={id}"
|
380
397
|
},
|
381
398
|
{ "rel": "credit_notes",
|
382
|
-
"href": "
|
399
|
+
"href": "credit_notes?filter[contact_ids]={id}"
|
383
400
|
},
|
384
401
|
{ "rel": "recurrings",
|
385
|
-
"href": "
|
402
|
+
"href": "recurrings?filter[contact_ids]={id}"
|
386
403
|
},
|
387
404
|
{ "rel": "payment_reminders",
|
388
|
-
"href": "
|
405
|
+
"href": "payment_reminders?filter[contact_ids]={id}"
|
389
406
|
},
|
390
407
|
{ "rel": "comments",
|
391
|
-
"href": "
|
408
|
+
"href": "comments?filter[related_object_ids]={id}"
|
392
409
|
},
|
393
410
|
{ "rel": "emails",
|
394
|
-
"href": "
|
395
|
-
},
|
396
|
-
{ "rel": "emails create",
|
397
|
-
"href": "contacts/{id}/emails",
|
398
|
-
"method": "POST",
|
399
|
-
"properties" : {
|
400
|
-
"template_id":{
|
401
|
-
"title" : "Template",
|
402
|
-
"description": "UUID of an email template to use. If present template fields like subject, body, attachments are used for the current email.",
|
403
|
-
"type":"string",
|
404
|
-
"maxLength": 22,
|
405
|
-
"minLength":22
|
406
|
-
},
|
407
|
-
"send":{
|
408
|
-
"title" : "Send email",
|
409
|
-
"description": "Schedule email for sending. Omit this parameter or set value to 0 or false(String or Integer) to keep email as draft."
|
410
|
-
},
|
411
|
-
"archived_pdf":{
|
412
|
-
"title" : "Attach archived pdf",
|
413
|
-
"description": "Adds the archived pdf from the related resource(if it has one)."
|
414
|
-
}
|
415
|
-
}
|
411
|
+
"href": "emails?filter[related_object_ids]={id}"
|
416
412
|
}
|
417
413
|
]
|
418
414
|
}
|