sk_api_schema 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,35 +1,39 @@
1
1
  { "type":"object",
2
2
  "title": "comment",
3
3
  "description":"An comment in SK must always be related to an object.",
4
- "properties": {
5
- "id": {
6
- "description": "uuid of the comment",
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
- "text": {
13
+ "text":{
12
14
  "description": "The comment himself.",
13
15
  "required":true,
14
16
  "type":"string"
15
17
  },
16
- "related_object_type": {
18
+ "related_object_type":{
17
19
  "description": "Object type of the comments parent. Is the camelcased base class name: Document for invoice, credit_note,.., Contact for client",
18
20
  "required":true,
19
21
  "type":"string"
20
22
  },
21
- "related_object_id": {
23
+ "related_object_id":{
22
24
  "description": "uuid of the comments parent object.",
23
25
  "required":true,
24
- "type":"string"
26
+ "type":"string",
27
+ "maxLength": 22,
28
+ "minLength":22
25
29
  },
26
- "created_at": {
30
+ "created_at":{
27
31
  "description": "Date the object was created in SK. Never changes afterwards",
28
32
  "format":"date-time",
29
33
  "readonly":true,
30
34
  "type":"string"
31
35
  },
32
- "updated_at": {
36
+ "updated_at":{
33
37
  "description": "Date the object was edited in SK.",
34
38
  "format":"date-time",
35
39
  "readonly":true,
@@ -37,7 +41,9 @@
37
41
  },
38
42
  "team_id":{
39
43
  "description": "A team uuid. If set only the team and its parent teams can see the record.",
40
- "type":"string"
44
+ "type":"string",
45
+ "maxLength": 22,
46
+ "minLength":22
41
47
  }
42
48
  },
43
49
  "links":[
@@ -1,105 +1,126 @@
1
1
  { "type":"object",
2
2
  "title": "company",
3
- "description": "A company is the main entity, so any data belongs to a company, identified by the current subdomain.",
4
- "properties": {
5
- "id": {
3
+ "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",
4
+ "properties":{
5
+ "id":{
6
+ "description":"Unique identifier - UUID",
6
7
  "identity":true,
7
8
  "readonly":true,
8
- "type":"string"
9
+ "type":"string",
10
+ "maxLength": 22,
11
+ "minLength":22
9
12
  },
10
- "name": {
13
+ "name":{
11
14
  "description": "Company name",
12
- "type":"string"
15
+ "type":"string",
16
+ "maxLength": 100
13
17
  },
14
- "language": {
15
- "description": "Default language, used for new users",
16
- "type":"string"
17
- },
18
- "sub_domain": {
18
+ "language":{
19
+ "description": "Default language, used for new users. Must be a valid language available in SalesKing",
20
+ "type":"string",
21
+ "maxLength": 10
22
+ },
23
+ "sub_domain":{
19
24
  "description": "Unique subdomain identifying the company's SalesKing account.",
20
- "type":"string"
25
+ "type":"string",
26
+ "maxLength": 20
21
27
  },
22
- "account_link": {
28
+ "account_link":{
23
29
  "description": "Link to a company's SalesKing account.",
24
30
  "type":"string",
31
+ "format":"uri",
25
32
  "readonly":true
26
33
  },
27
- "time_zone": {
34
+ "time_zone":{
28
35
  "description": "Default time zone, used for new users",
29
- "type":"string"
36
+ "type":"string",
37
+ "maxLength": 50
30
38
  },
31
- "email": {
39
+ "email":{
32
40
  "description": "Email address",
33
41
  "required":true,
34
- "type":"string"
42
+ "type":"string",
43
+ "maxLength": 100
35
44
  },
36
- "url": {
45
+ "url":{
37
46
  "description": "A company website",
38
- "type":"string"
39
- },
40
- "phone_fax": {
47
+ "type":"string",
48
+ "maxLength": 255
49
+ },
50
+ "phone_fax":{
41
51
  "description": "Fax number",
42
- "type":"string"
52
+ "type":"string",
53
+ "maxLength": 30
43
54
  },
44
- "phone_office": {
55
+ "phone_office":{
45
56
  "description": "Office phone number",
46
- "type":"string"
57
+ "type":"string",
58
+ "maxLength": 30
47
59
  },
48
- "phone_mobile": {
60
+ "phone_mobile":{
49
61
  "description": "Mobile phone number",
50
- "type":"string"
62
+ "type":"string",
63
+ "maxLength": 30
51
64
  },
52
- "tax_number": {
65
+ "tax_number":{
53
66
  "description": "Tax number, normally applies to a private person running a small business.",
54
- "type":"string"
67
+ "type":"string",
68
+ "maxLength": 30
55
69
  },
56
- "addresses": {
70
+ "addresses":{
57
71
  "description": "A company can have many addresses, sorted by date descending(new first). Default address used in placeholder is the most recent one.",
58
72
  "type":"array",
59
73
  "properties" : {"$ref":"./addresses.json#properties"}
60
74
  },
61
- "vat_number": {
75
+ "vat_number":{
62
76
  "description": "VAT number, for a company entitled to pay value added taxes.",
63
- "type":"string"
77
+ "type":"string",
78
+ "maxLength": 30
64
79
  },
65
- "bank_name": {
80
+ "bank_name":{
66
81
  "description": "Bank name",
67
- "type":"string"
82
+ "type":"string",
83
+ "maxLength": 70
68
84
  },
69
- "bank_number": {
85
+ "bank_number":{
70
86
  "description": "Bank number",
71
- "type":"string"
87
+ "type":"string",
88
+ "maxLength": 35
72
89
  },
73
- "bank_account_number": {
90
+ "bank_account_number":{
74
91
  "description": "Bank account number.",
75
- "type":"string"
92
+ "type":"string",
93
+ "maxLength": 35
76
94
  },
77
- "bank_iban": {
95
+ "bank_iban":{
78
96
  "description": "IBAN Number of the bank account. Is validated",
79
- "type":"string"
97
+ "type":"string",
98
+ "maxLength": 35
80
99
  },
81
- "bank_swift": {
100
+ "bank_swift":{
82
101
  "description": "SWIFT BIC- Bank Identifier Code",
83
- "type":"string"
102
+ "type":"string",
103
+ "maxLength": 11
84
104
  },
85
- "bank_owner": {
105
+ "bank_owner":{
86
106
  "description": "Bank account owner",
87
- "type":"string"
107
+ "type":"string",
108
+ "maxLength": 70
88
109
  },
89
- "created_at": {
110
+ "created_at":{
90
111
  "description": "Date the record was created in SK. Never changes afterwards.",
91
112
  "format":"date-time",
92
113
  "readonly":true,
93
114
  "type":"string"
94
115
  },
95
- "updated_at": {
116
+ "updated_at":{
96
117
  "description": "Last date when the record was edited.",
97
118
  "format":"date-time",
98
119
  "readonly":true,
99
120
  "type":"string"
100
121
  }
101
122
  },
102
-
123
+
103
124
  "links":[
104
125
  { "rel": "current",
105
126
  "href": "companies/current"
@@ -3,14 +3,17 @@
3
3
  "description": "A credit note",
4
4
  "properties":{
5
5
  "id":{
6
- "description": "UUID assigned by SK",
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 credit note number schema. Auto-assigned when document 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": "Address field with the receiver. Shown in envelope window.",
@@ -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 beeing payed. Used in new payments.",
48
+ "description": "How the document is being payed. Used for 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 exessive typing e.g. 'Your credit note [number]'",
50
- "type":"string"
53
+ "description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your credit note [number]'",
54
+ "type":"string",
55
+ "maxLength": 255
51
56
  },
52
57
  "notes_before":{
53
- "description": "Notes shown before the line items. Normaly contains salutation and other introductional information. SK placeholders can be used.",
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 seperated 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, due days and cash discount 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",
@@ -157,7 +168,7 @@
157
168
  },
158
169
  "filter[q]":{
159
170
  "title" : "Search",
160
- "description": "Search in title, number, addressfield",
171
+ "description": "Search in title, number, address field",
161
172
  "type":"string"
162
173
  },
163
174
  "filter[number]":{
@@ -251,6 +262,9 @@
251
262
  { "rel": "attachments",
252
263
  "href": "credit_notes/{id}/attachments"
253
264
  },
265
+ { "rel": "payments",
266
+ "href": "credit_notes/{id}/payments"
267
+ },
254
268
  { "rel": "comments",
255
269
  "href": "credit_notes/{id}/comments"
256
270
  },
@@ -1,12 +1,14 @@
1
1
  { "type":"object",
2
2
  "title": "document",
3
- "description": "This resource is readonly and serves as a convinient way to query documents independent of their type(invoice, order,..). The specific document type is set in each object in the result-set.",
3
+ "description": "This resource is readonly and serves as a convenient way to query documents independent of their type(invoice, order,..). The specific document type is set in each object in the result-set.",
4
4
  "properties":{
5
5
  "id":{
6
- "description": "UUID assigned by SK",
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
  "object_type":{
12
14
  "description": "The specific type of the document",
@@ -14,7 +16,8 @@
14
16
  },
15
17
  "number":{
16
18
  "description": "Unique number assigned by a user or automatic by the object's number schema.",
17
- "type":"string"
19
+ "type":"string",
20
+ "maxLength": 50
18
21
  },
19
22
  "address_field":{
20
23
  "description": "Receiver address, normally shown in envelope window. Defaults to client address_field.",
@@ -27,28 +30,34 @@
27
30
  },
28
31
  "external_ref":{
29
32
  "description": "Some external reference, whatever this may be.",
30
- "type":"string"
33
+ "type":"string",
34
+ "maxLength": 255
31
35
  },
32
36
  "title":{
33
- "description": "The headline of a document. Use SK placeholders to prevent exessive typing e.g. 'Your invoice [number]'",
34
- "type":"string"
37
+ "description": "The headline of a document. Use SK placeholders to prevent excessive typing e.g. 'Your invoice [number]'",
38
+ "type":"string",
39
+ "maxLength": 255
35
40
  },
36
41
  "notes_before":{
37
- "description": "Notes shown before the line items. Normaly contains salutation and other introductional information. SK placeholders can be used.",
38
- "type":"string"
42
+ "description": "Notes shown before the line items. Normally contains salutation and other introductional information. SK placeholders can be used.",
43
+ "type":"string",
44
+ "format":"text"
39
45
  },
40
46
  "notes_after":{
41
47
  "description": "Notes shown after the line items. Can contain information about payments, bank account or a thank-you message. SK placeholders can be used.",
42
- "type":"string"
48
+ "type":"string",
49
+ "format":"text"
43
50
  },
44
- "tag_list": {
45
- "description": "Space separated list of tags.",
51
+ "tag_list":{
52
+ "description": "Space separated list of tags. Are split and saved as Tag objects on create, update.",
46
53
  "type":"string"
47
54
  },
48
55
  "client_id":{
49
56
  "description": "The clients uuid",
50
57
  "type":"string",
51
- "required":true
58
+ "required":true,
59
+ "maxLength": 22,
60
+ "minLength":22
52
61
  },
53
62
  "team_id":{
54
63
  "description": "A team uuid. If set only the team and its parent teams can see the record.",
@@ -111,7 +120,7 @@
111
120
  },
112
121
  "filter[q]":{
113
122
  "title" : "Search",
114
- "description": "Search in title, number, addressfield",
123
+ "description": "Search in title, number, address field",
115
124
  "type":"string"
116
125
  },
117
126
  "filter[number]":{
data/json/v1.0/email.json CHANGED
@@ -1,40 +1,48 @@
1
1
  { "type":"object",
2
2
  "title": "email",
3
3
  "description":"An email in SK must always be related to an object. Receivers are limited to 5 per address field.",
4
- "properties": {
5
- "id": {
6
- "description": "uuid of the email",
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
- "bcc_addr": {
13
+ "bcc_addr":{
12
14
  "description": "BCC addresses, comma separated. Max 5, format: a@b.de,'George'<georg@sk.eu>",
13
- "type":"string"
15
+ "type":"string",
16
+ "format":"text"
14
17
  },
15
- "cc_addr": {
18
+ "cc_addr":{
16
19
  "description": "CC addresses, comma separated. Max 5, format: a@b.de,'George'<georg@sk.eu>",
17
- "type":"string"
20
+ "type":"string",
21
+ "format":"text"
18
22
  },
19
- "from_addr": {
23
+ "from_addr":{
20
24
  "description": "From address",
21
25
  "required":true,
22
- "type":"string"
26
+ "type":"string",
27
+ "maxLength": 255
23
28
  },
24
- "to_addr": {
29
+ "to_addr":{
25
30
  "description": "TO addresses, comma separated. Max 5, format: a@b.de,'George'<georg@sk.eu>",
26
31
  "required":true,
27
- "type":"string"
32
+ "type":"string",
33
+ "format":"text"
28
34
  },
29
- "subject": {
35
+ "subject":{
30
36
  "description": "The email subject.",
31
37
  "required":true,
32
- "type":"string"
38
+ "type":"string",
39
+ "maxLength": 255
33
40
  },
34
- "body": {
41
+ "body":{
35
42
  "description": "The email text.",
36
43
  "required":true,
37
- "type":"string"
44
+ "type":"string",
45
+ "format":"text"
38
46
  },
39
47
  "attachments":{
40
48
  "description": "The emails attachments.",
@@ -42,34 +50,36 @@
42
50
  "type":"array",
43
51
  "properties":{"$ref":"./attachment.json#properties"}
44
52
  },
45
- "related_object_type": {
53
+ "related_object_type":{
46
54
  "description": "Object type of the emails parent. Is the camelcased base class name: Document for invoice, credit_note,.., Contact for client",
47
55
  "required":true,
48
56
  "type":"string"
49
57
  },
50
- "related_object_id": {
58
+ "related_object_id":{
51
59
  "description": "uuid of the emails parent object.",
52
60
  "required":true,
53
- "type":"string"
61
+ "type":"string",
62
+ "maxLength": 22,
63
+ "minLength":22
54
64
  },
55
- "in_progress": {
65
+ "in_progress":{
56
66
  "description": "Is set after an email has been scheduled for sending until it has been sent.",
57
67
  "readonly":true,
58
68
  "type":"boolean"
59
69
  },
60
- "delivered_at": {
70
+ "delivered_at":{
61
71
  "description": "Date the email was delivered by SK. If set, the message cannot be edited anymore.",
62
72
  "format":"date-time",
63
73
  "readonly":true,
64
74
  "type":"string"
65
75
  },
66
- "created_at": {
76
+ "created_at":{
67
77
  "description": "Date the object was created in SK. Never changes afterwards",
68
78
  "format":"date-time",
69
79
  "readonly":true,
70
80
  "type":"string"
71
81
  },
72
- "updated_at": {
82
+ "updated_at":{
73
83
  "description": "Date the object was edited in SK.",
74
84
  "format":"date-time",
75
85
  "readonly":true,
@@ -77,7 +87,9 @@
77
87
  },
78
88
  "team_id":{
79
89
  "description": "A team uuid. If set only the team and its parent teams can see the record.",
80
- "type":"string"
90
+ "type":"string",
91
+ "maxLength": 22,
92
+ "minLength":22
81
93
  }
82
94
  },
83
95
  "links":[
@@ -157,7 +169,9 @@
157
169
  "template_id":{
158
170
  "title" : "Template",
159
171
  "description": "UUID of an email template to use. If present, subject, body and attachments of the template are used for the current email.",
160
- "type":"string"
172
+ "type":"string",
173
+ "maxLength": 22,
174
+ "minLength":22
161
175
  },
162
176
  "send":{
163
177
  "title" : "Send email",