sk_api_schema 0.3.4 → 0.4.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.
- data/CHANGELOG.rdoc +1 -0
- data/README.rdoc +81 -41
- data/json/v1.0/address.json +24 -22
- data/json/v1.0/attachment.json +26 -17
- data/json/v1.0/auth_permission.json +18 -11
- data/json/v1.0/client.json +42 -37
- data/json/v1.0/comment.json +17 -11
- data/json/v1.0/company.json +67 -46
- data/json/v1.0/credit_note.json +29 -15
- data/json/v1.0/document.json +23 -14
- data/json/v1.0/email.json +39 -25
- data/json/v1.0/email_template.json +22 -15
- data/json/v1.0/estimate.json +25 -14
- data/json/v1.0/export.json +27 -18
- data/json/v1.0/export_template.json +22 -15
- data/json/v1.0/invoice.json +29 -15
- data/json/v1.0/language.json +10 -6
- data/json/v1.0/line_item.json +17 -10
- data/json/v1.0/order.json +26 -15
- data/json/v1.0/payment.json +20 -13
- data/json/v1.0/payment_reminder.json +26 -14
- data/json/v1.0/product.json +17 -9
- data/json/v1.0/recurring.json +26 -15
- data/json/v1.0/sub.json +16 -10
- data/json/v1.0/tag.json +12 -9
- data/json/v1.0/text_template.json +20 -14
- data/json/v1.0/user.json +45 -31
- data/lib/sk_api_schema/version.rb +1 -1
- metadata +3 -3
data/json/v1.0/line_item.json
CHANGED
@@ -3,10 +3,12 @@
|
|
3
3
|
"description": "A line item for a document",
|
4
4
|
"properties":{
|
5
5
|
"id":{
|
6
|
-
"description":
|
6
|
+
"description":"Unique identifier - UUID",
|
7
7
|
"identity":true,
|
8
8
|
"readonly":true,
|
9
|
-
"type":"string"
|
9
|
+
"type":"string",
|
10
|
+
"maxLength": 22,
|
11
|
+
"minLength":22
|
10
12
|
},
|
11
13
|
"position":{
|
12
14
|
"description": "Required since items are sorted by position.",
|
@@ -15,11 +17,13 @@
|
|
15
17
|
},
|
16
18
|
"name":{
|
17
19
|
"description": "The name of an item",
|
18
|
-
"type":"string"
|
20
|
+
"type":"string",
|
21
|
+
"maxLength": 50
|
19
22
|
},
|
20
23
|
"description":{
|
21
24
|
"description": "Item description",
|
22
|
-
"type":"string"
|
25
|
+
"type":"string",
|
26
|
+
"format": "text"
|
23
27
|
},
|
24
28
|
"price_single":{
|
25
29
|
"description": "Net price of a single item",
|
@@ -30,22 +34,25 @@
|
|
30
34
|
"type":"number"
|
31
35
|
},
|
32
36
|
"discount":{
|
33
|
-
"description": "Discount in percent applied to the items net total",
|
37
|
+
"description": "Discount in percent applied to the items net total. Can also be negative if you want to add additional charges.",
|
34
38
|
"type":"number"
|
35
39
|
},
|
36
40
|
"quantity_unit":{
|
37
41
|
"description": "Quantity unit: kg, days, month.",
|
38
|
-
"type":"string"
|
42
|
+
"type":"string",
|
43
|
+
"maxLength": 30
|
39
44
|
},
|
40
45
|
"quantity":{
|
41
|
-
"description": "Quantity of the item. Must be
|
46
|
+
"description": "Quantity of the item. Must be >= 0",
|
42
47
|
"type":"number",
|
43
|
-
"
|
48
|
+
"minimum":0,
|
44
49
|
"required":true
|
45
50
|
},
|
46
51
|
"product_id":{
|
47
52
|
"description": "A uuid of a product, referenced in this item. This makes it easier to track a products turnover and list the documents it is used on. Also see use_product",
|
48
|
-
"type":"string"
|
53
|
+
"type":"string",
|
54
|
+
"maxLength": 22,
|
55
|
+
"minLength":22
|
49
56
|
},
|
50
57
|
"use_product":{
|
51
58
|
"description": "If set and product_id is present, the products name, description, quantity, unit, price are copied if the according item fields are missing.",
|
@@ -63,7 +70,7 @@
|
|
63
70
|
"readonly":true,
|
64
71
|
"type":"string"
|
65
72
|
},
|
66
|
-
"_destroy":
|
73
|
+
"_destroy":{
|
67
74
|
"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.",
|
68
75
|
"type":"boolean"
|
69
76
|
}
|
data/json/v1.0/order.json
CHANGED
@@ -3,14 +3,17 @@
|
|
3
3
|
"description": "An order",
|
4
4
|
"properties":{
|
5
5
|
"id":{
|
6
|
-
"description":
|
6
|
+
"description":"Unique identifier - UUID",
|
7
7
|
"identity":true,
|
8
8
|
"readonly":true,
|
9
|
-
"type":"string"
|
9
|
+
"type":"string",
|
10
|
+
"maxLength": 22,
|
11
|
+
"minLength":22
|
10
12
|
},
|
11
13
|
"number":{
|
12
14
|
"description": "Unique number assigned by SK order number schema. Auto-assigned when order is opened. Required unless doc status is draft.",
|
13
|
-
"type":"string"
|
15
|
+
"type":"string",
|
16
|
+
"maxLength": 50
|
14
17
|
},
|
15
18
|
"address_field":{
|
16
19
|
"description": "Receiver address, normally shown in envelope window. Defaults to client address_field if empty and client_id present.",
|
@@ -38,27 +41,31 @@
|
|
38
41
|
},
|
39
42
|
"external_ref":{
|
40
43
|
"description": "Some external reference, whatever this may be.",
|
41
|
-
"type":"string"
|
44
|
+
"type":"string",
|
45
|
+
"maxLength": 255
|
42
46
|
},
|
43
47
|
"payment_method":{
|
44
|
-
"description": "How the document is
|
48
|
+
"description": "How the document is being payed. Used in new payments.",
|
45
49
|
"enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"],
|
46
50
|
"type":"string"
|
47
51
|
},
|
48
52
|
"title":{
|
49
|
-
"description": "The headline of a document. Use SK placeholders to prevent
|
50
|
-
"type":"string"
|
53
|
+
"description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your order [number]'",
|
54
|
+
"type":"string",
|
55
|
+
"maxLength": 255
|
51
56
|
},
|
52
57
|
"notes_before":{
|
53
|
-
"description": "Notes shown before the line items.
|
54
|
-
"type":"string"
|
58
|
+
"description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
|
59
|
+
"type":"string",
|
60
|
+
"format":"text"
|
55
61
|
},
|
56
62
|
"notes_after":{
|
57
63
|
"description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.",
|
58
|
-
"type":"string"
|
64
|
+
"type":"string",
|
65
|
+
"format":"text"
|
59
66
|
},
|
60
|
-
"tag_list":
|
61
|
-
"description": "Space separated list of tags.",
|
67
|
+
"tag_list":{
|
68
|
+
"description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
|
62
69
|
"type":"string"
|
63
70
|
},
|
64
71
|
"language":{
|
@@ -80,11 +87,15 @@
|
|
80
87
|
},
|
81
88
|
"client_id":{
|
82
89
|
"description": "The clients uuid. If a new client is assigned its language, address field are used if those fields are not set.",
|
83
|
-
"type":"string"
|
90
|
+
"type":"string",
|
91
|
+
"maxLength": 22,
|
92
|
+
"minLength":22
|
84
93
|
},
|
85
94
|
"team_id":{
|
86
95
|
"description": "A team uuid. If set only the team and its parent teams can see the record.",
|
87
|
-
"type":"string"
|
96
|
+
"type":"string",
|
97
|
+
"maxLength": 22,
|
98
|
+
"minLength":22
|
88
99
|
},
|
89
100
|
"line_items":{
|
90
101
|
"description": "Line items for the document",
|
@@ -147,7 +158,7 @@
|
|
147
158
|
},
|
148
159
|
"filter[q]":{
|
149
160
|
"title" : "Search",
|
150
|
-
"description": "Search in title, number,
|
161
|
+
"description": "Search in title, number, address field",
|
151
162
|
"type":"string"
|
152
163
|
},
|
153
164
|
"filter[number]":{
|
data/json/v1.0/payment.json
CHANGED
@@ -1,21 +1,24 @@
|
|
1
1
|
{ "type":"object",
|
2
2
|
"title": "payment",
|
3
3
|
"description":"An payment in SK must always be related to an object.",
|
4
|
-
"properties":
|
5
|
-
"id":
|
6
|
-
"description":
|
4
|
+
"properties":{
|
5
|
+
"id":{
|
6
|
+
"description":"Unique identifier - UUID",
|
7
7
|
"identity":true,
|
8
8
|
"readonly":true,
|
9
|
-
"type":"string"
|
9
|
+
"type":"string",
|
10
|
+
"maxLength": 22,
|
11
|
+
"minLength":22
|
10
12
|
},
|
11
|
-
"amount":
|
13
|
+
"amount":{
|
12
14
|
"description": "The payment amount",
|
13
15
|
"required":true,
|
14
16
|
"type":"number"
|
15
17
|
},
|
16
18
|
"external_ref":{
|
17
19
|
"description": "Reference number f.ex. issued by the bank.",
|
18
|
-
"type":"string"
|
20
|
+
"type":"string",
|
21
|
+
"maxLength": 255
|
19
22
|
},
|
20
23
|
"date":{
|
21
24
|
"description": "Date the payment was made.",
|
@@ -31,21 +34,25 @@
|
|
31
34
|
"enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"],
|
32
35
|
"type":"string"
|
33
36
|
},
|
34
|
-
"related_object_type":
|
37
|
+
"related_object_type":{
|
35
38
|
"description": "Object type of the payments parent. Is the camel-cased base class name: Document for invoice, credit_note,.., Contact for client",
|
36
39
|
"required":true,
|
37
40
|
"type":"string"
|
38
41
|
},
|
39
|
-
"related_object_id":
|
42
|
+
"related_object_id":{
|
40
43
|
"description": "uuid of the payments parent object.",
|
41
44
|
"required":true,
|
42
|
-
"type":"string"
|
45
|
+
"type":"string",
|
46
|
+
"maxLength": 22,
|
47
|
+
"minLength":22
|
43
48
|
},
|
44
49
|
"team_id":{
|
45
50
|
"description": "A team uuid. If set only the team and its parent teams can see the record.",
|
46
|
-
"type":"string"
|
51
|
+
"type":"string",
|
52
|
+
"maxLength": 22,
|
53
|
+
"minLength":22
|
47
54
|
},
|
48
|
-
"created_at":
|
55
|
+
"created_at":{
|
49
56
|
"description": "Date the object was created in SK. Never changes afterwards",
|
50
57
|
"format":"date-time",
|
51
58
|
"readonly":true,
|
@@ -71,7 +78,7 @@
|
|
71
78
|
},
|
72
79
|
"filter[q]":{
|
73
80
|
"title" : "Search",
|
74
|
-
"description": "Search in title, number,
|
81
|
+
"description": "Search in title, number, address field",
|
75
82
|
"type":"string"
|
76
83
|
},
|
77
84
|
"filter[from]":{
|
@@ -110,7 +117,7 @@
|
|
110
117
|
"properties" : {
|
111
118
|
"new_doc_status":{
|
112
119
|
"title" : "New status for document",
|
113
|
-
"description": "
|
120
|
+
"description": "Convenience method to close a document with a payment.",
|
114
121
|
"enum": ["open","closed"],
|
115
122
|
"type":"string"
|
116
123
|
}
|
@@ -3,15 +3,19 @@
|
|
3
3
|
"description": "A payment reminder",
|
4
4
|
"properties":{
|
5
5
|
"id":{
|
6
|
-
"description":
|
6
|
+
"description":"Unique identifier - UUID",
|
7
7
|
"identity":true,
|
8
8
|
"readonly":true,
|
9
|
-
"type":"string"
|
9
|
+
"type":"string",
|
10
|
+
"maxLength": 22,
|
11
|
+
"minLength":22
|
10
12
|
},
|
11
13
|
"invoice_id":{
|
12
14
|
"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.",
|
13
15
|
"required": true,
|
14
|
-
"type":"string"
|
16
|
+
"type":"string",
|
17
|
+
"maxLength": 22,
|
18
|
+
"minLength":22
|
15
19
|
},
|
16
20
|
"address_field":{
|
17
21
|
"description": "Receiver address, shown in envelope window. Defaults to invoice.client.address_field if created from invoice.",
|
@@ -34,22 +38,26 @@
|
|
34
38
|
},
|
35
39
|
"external_ref":{
|
36
40
|
"description": "Some external reference, whatever this may be.",
|
37
|
-
"type":"string"
|
41
|
+
"type":"string",
|
42
|
+
"maxLength": 255
|
38
43
|
},
|
39
44
|
"title":{
|
40
|
-
"description": "The headline of a document. Use SK placeholders to prevent
|
41
|
-
"type":"string"
|
45
|
+
"description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your payment_reminder [number]'. Defaults to values from settings",
|
46
|
+
"type":"string",
|
47
|
+
"maxLength": 255
|
42
48
|
},
|
43
49
|
"notes_before":{
|
44
|
-
"description": "Notes shown before the line items.
|
45
|
-
"type":"string"
|
50
|
+
"description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used. Defaults to values from settings",
|
51
|
+
"type":"string",
|
52
|
+
"format":"text"
|
46
53
|
},
|
47
54
|
"notes_after":{
|
48
55
|
"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",
|
49
|
-
"type":"string"
|
56
|
+
"type":"string",
|
57
|
+
"format":"text"
|
50
58
|
},
|
51
|
-
"tag_list":
|
52
|
-
"description": "Space separated list of tags.",
|
59
|
+
"tag_list":{
|
60
|
+
"description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
|
53
61
|
"type":"string"
|
54
62
|
},
|
55
63
|
"language":{
|
@@ -71,11 +79,15 @@
|
|
71
79
|
},
|
72
80
|
"client_id":{
|
73
81
|
"description": "The clients uuid. Is assigned throught the related invoice.",
|
74
|
-
"type":"string"
|
82
|
+
"type":"string",
|
83
|
+
"maxLength": 22,
|
84
|
+
"minLength":22
|
75
85
|
},
|
76
86
|
"team_id":{
|
77
87
|
"description": "A team uuid. If set, only the team and its parent teams can see the record. Defaults to team id from invoice",
|
78
|
-
"type":"string"
|
88
|
+
"type":"string",
|
89
|
+
"maxLength": 22,
|
90
|
+
"minLength":22
|
79
91
|
},
|
80
92
|
"line_items":{
|
81
93
|
"description": "Line items for the document. Defaults to invoice.gross_total and late fee values from settings",
|
@@ -128,7 +140,7 @@
|
|
128
140
|
},
|
129
141
|
"filter[q]":{
|
130
142
|
"title" : "Search",
|
131
|
-
"description": "Search in title, number,
|
143
|
+
"description": "Search in title, number, address field",
|
132
144
|
"type":"string"
|
133
145
|
},
|
134
146
|
"filter[tags]":{
|
data/json/v1.0/product.json
CHANGED
@@ -3,23 +3,28 @@
|
|
3
3
|
"description": "A product in SK",
|
4
4
|
"properties":{
|
5
5
|
"id":{
|
6
|
-
"description":
|
6
|
+
"description":"Unique identifier - UUID",
|
7
7
|
"identity":true,
|
8
8
|
"readonly":true,
|
9
|
-
"type":"string"
|
9
|
+
"type":"string",
|
10
|
+
"maxLength": 22,
|
11
|
+
"minLength":22
|
10
12
|
},
|
11
13
|
"number":{
|
12
14
|
"description": "Unique number assigned by you or if empty SK product number schema.",
|
13
|
-
"type":"string"
|
15
|
+
"type":"string",
|
16
|
+
"maxLength": 50
|
14
17
|
},
|
15
18
|
"name":{
|
16
19
|
"description": "The name of the product",
|
17
20
|
"type":"string",
|
18
|
-
"required":true
|
21
|
+
"required":true,
|
22
|
+
"maxLength": 50
|
19
23
|
},
|
20
24
|
"description":{
|
21
25
|
"description": "Product description",
|
22
|
-
"type":"string"
|
26
|
+
"type":"string",
|
27
|
+
"format":"text"
|
23
28
|
},
|
24
29
|
"price":{
|
25
30
|
"description": "Net price of a single product",
|
@@ -31,7 +36,8 @@
|
|
31
36
|
},
|
32
37
|
"quantity_unit":{
|
33
38
|
"description": "Unit like kg, days, month.",
|
34
|
-
"type":"string"
|
39
|
+
"type":"string",
|
40
|
+
"maxLength": 30
|
35
41
|
},
|
36
42
|
"created_at":{
|
37
43
|
"description": "Date the object was created in SK. Never changes afterwards",
|
@@ -47,9 +53,11 @@
|
|
47
53
|
},
|
48
54
|
"team_id":{
|
49
55
|
"description": "A team uuid. If set only the team and its parent teams can see the record.",
|
50
|
-
"type":"string"
|
56
|
+
"type":"string",
|
57
|
+
"maxLength": 22,
|
58
|
+
"minLength":22
|
51
59
|
},
|
52
|
-
"lock_version":
|
60
|
+
"lock_version":{
|
53
61
|
"description": "Increased on every edit, so SK can detect/prevent a concurrent edit by another user. First save wins.",
|
54
62
|
"type":"integer"
|
55
63
|
}
|
@@ -75,7 +83,7 @@
|
|
75
83
|
"title" : "Search",
|
76
84
|
"description": "Searches in number, name, description, price",
|
77
85
|
"type":"string"
|
78
|
-
},
|
86
|
+
},
|
79
87
|
"sort_by":{
|
80
88
|
"title" : "Sort by",
|
81
89
|
"description": "Sort the results by the given field => number",
|
data/json/v1.0/recurring.json
CHANGED
@@ -3,15 +3,18 @@
|
|
3
3
|
"description": "An recurring is used as an template for new invoices.",
|
4
4
|
"properties":{
|
5
5
|
"id":{
|
6
|
-
"description":
|
6
|
+
"description":"Unique identifier - UUID",
|
7
7
|
"identity":true,
|
8
8
|
"readonly":true,
|
9
|
-
"type":"string"
|
9
|
+
"type":"string",
|
10
|
+
"maxLength": 22,
|
11
|
+
"minLength":22
|
10
12
|
},
|
11
13
|
"number":{
|
12
14
|
"description": "Unique name to identify the document. Unlike all other document this one has no number schema and not auto assign",
|
13
15
|
"type":"string",
|
14
|
-
"required":true
|
16
|
+
"required":true,
|
17
|
+
"maxLength": 50
|
15
18
|
},
|
16
19
|
"address_field":{
|
17
20
|
"description": "Receiver address, normally shown in envelope window. Defaults to client address_field if empty and client_id given.",
|
@@ -40,28 +43,32 @@
|
|
40
43
|
"required":true
|
41
44
|
},
|
42
45
|
"payment_method":{
|
43
|
-
"description": "How the document is
|
46
|
+
"description": "How the document is being payed. Used in new payments.",
|
44
47
|
"enum":["cash","bank_transfer","credit_card","paypal","direct_debit","cheque", "moneybookers", "premium_sms"],
|
45
48
|
"type":"string"
|
46
49
|
},
|
47
50
|
"external_ref":{
|
48
51
|
"description": "Some external reference, whatever this may be.",
|
49
|
-
"type":"string"
|
52
|
+
"type":"string",
|
53
|
+
"maxLength": 255
|
50
54
|
},
|
51
55
|
"title":{
|
52
|
-
"description": "The headline of a document. Use SK placeholders to prevent
|
53
|
-
"type":"string"
|
56
|
+
"description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your recurring [number]'",
|
57
|
+
"type":"string",
|
58
|
+
"maxLength": 255
|
54
59
|
},
|
55
60
|
"notes_before":{
|
56
|
-
"description": "Notes shown before the line items.
|
57
|
-
"type":"string"
|
61
|
+
"description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
|
62
|
+
"type":"string",
|
63
|
+
"format":"text"
|
58
64
|
},
|
59
65
|
"notes_after":{
|
60
66
|
"description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.",
|
61
|
-
"type":"string"
|
67
|
+
"type":"string",
|
68
|
+
"format":"text"
|
62
69
|
},
|
63
|
-
"tag_list":
|
64
|
-
"description": "Space separated list of tags.",
|
70
|
+
"tag_list":{
|
71
|
+
"description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
|
65
72
|
"type":"string"
|
66
73
|
},
|
67
74
|
"language":{
|
@@ -77,11 +84,15 @@
|
|
77
84
|
},
|
78
85
|
"client_id":{
|
79
86
|
"description": "The clients uuid. If a new client is assigned its language, address field, due days and cash discount are used if those fields are not set.",
|
80
|
-
"type":"string"
|
87
|
+
"type":"string",
|
88
|
+
"maxLength": 22,
|
89
|
+
"minLength":22
|
81
90
|
},
|
82
91
|
"team_id":{
|
83
92
|
"description": "A team uuid. If set only the team and its parent teams can see the record.",
|
84
|
-
"type":"string"
|
93
|
+
"type":"string",
|
94
|
+
"maxLength": 22,
|
95
|
+
"minLength":22
|
85
96
|
},
|
86
97
|
"line_items":{
|
87
98
|
"description": "Line items for the document",
|
@@ -144,7 +155,7 @@
|
|
144
155
|
},
|
145
156
|
"filter[q]":{
|
146
157
|
"title" : "Search",
|
147
|
-
"description": "Search in title, number,
|
158
|
+
"description": "Search in title, number, address field",
|
148
159
|
"type":"string"
|
149
160
|
},
|
150
161
|
"filter[tags]":{
|