Skip to content

Commit 133053b

Browse files
authored
Merge pull request #13 from servicetitan/schema-update-4b6ccd53cd76d82e71cad8697b7f2dfed9c176ad-29
Update API contract schemas
2 parents a99a5ff + 0c8e0ed commit 133053b

File tree

72 files changed

+7875
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+7875
-0
lines changed

st-schemas/account/request.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "account.request",
4+
"type": "object",
5+
"description": "Request for activating a customer's vendor account\nUsed when the user manually enters account information for a vendor",
6+
"additionalProperties": false,
7+
"properties": {
8+
"accountId": {
9+
"type": "string",
10+
"description": "The main account identifier for the supplier"
11+
},
12+
"customIdentifierFields": {
13+
"type": [
14+
"null",
15+
"object"
16+
],
17+
"description": "A collection of identifiers specific to the Vendor.\nThese were either previously returned by the vendor, or configured by the user based on vendor-specific inputs",
18+
"additionalProperties": {
19+
"type": "string"
20+
}
21+
},
22+
"vendorId": {
23+
"type": "string"
24+
},
25+
"callbackData": {
26+
"type": [
27+
"null",
28+
"object"
29+
],
30+
"description": "Generic data that is specified by the previous request's CallbackInfo",
31+
"additionalProperties": {}
32+
},
33+
"pageNumber": {
34+
"type": "integer",
35+
"format": "int32"
36+
}
37+
}
38+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"accountId": "accountId",
3+
"customIdentifierFields": {},
4+
"vendorId": "vendorId",
5+
"callbackData": {},
6+
"pageNumber": 0
7+
}

st-schemas/account/response.json

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "account.response",
4+
"type": "object",
5+
"description": "Response for activating a customer's vendor account",
6+
"additionalProperties": false,
7+
"properties": {
8+
"errorCode": {
9+
"type": [
10+
"null",
11+
"string"
12+
],
13+
"description": "Error code returned from the vendor's API, if any"
14+
},
15+
"callBackInfo": {
16+
"description": "Optional callback information to be used in the next request. Only present if a callback is needed",
17+
"oneOf": [
18+
{
19+
"type": "null"
20+
},
21+
{
22+
"$ref": "#/definitions/CallbackInfo"
23+
}
24+
]
25+
},
26+
"success": {
27+
"type": "boolean"
28+
},
29+
"errorKind": {
30+
"type": [
31+
"null",
32+
"string"
33+
]
34+
},
35+
"message": {
36+
"type": [
37+
"null",
38+
"string"
39+
]
40+
},
41+
"errorMessage": {
42+
"type": [
43+
"null",
44+
"string"
45+
]
46+
},
47+
"account": {
48+
"description": "Customer's vendor account information. This will be used in all future requests to the vendor",
49+
"oneOf": [
50+
{
51+
"type": "null"
52+
},
53+
{
54+
"$ref": "#/definitions/VendorAccountDto"
55+
}
56+
]
57+
},
58+
"accounts": {
59+
"type": "array",
60+
"items": {
61+
"$ref": "#/definitions/VendorSubAccountDto"
62+
}
63+
},
64+
"hasMorePages": {
65+
"type": "boolean"
66+
},
67+
"$schema": {
68+
"type": "string",
69+
"default": "./account.response.schema.json"
70+
}
71+
},
72+
"definitions": {
73+
"CallbackInfo": {
74+
"type": "object",
75+
"additionalProperties": false,
76+
"properties": {
77+
"shouldCallback": {
78+
"type": "boolean",
79+
"description": "Controls whether another request should be made"
80+
},
81+
"values": {
82+
"type": [
83+
"null",
84+
"object"
85+
],
86+
"description": "Generic object to be passed to the next request\nUsed for passing data between chained requests",
87+
"additionalProperties": {}
88+
}
89+
}
90+
},
91+
"VendorAccountDto": {
92+
"type": "object",
93+
"description": "Model representing a customer's vendor account",
94+
"additionalProperties": false,
95+
"properties": {
96+
"accountId": {
97+
"type": "string",
98+
"description": "Customer's vendor accountId"
99+
},
100+
"name": {
101+
"type": "string",
102+
"description": "Display name for the account"
103+
},
104+
"postalCode": {
105+
"type": [
106+
"null",
107+
"string"
108+
],
109+
"description": "Postal code associated with vendor accountId"
110+
},
111+
"pricingGroup": {
112+
"type": [
113+
"null",
114+
"string"
115+
],
116+
"description": "Customer's pricing group e.g. MainStoreCode"
117+
},
118+
"includeAccount": {
119+
"type": "boolean",
120+
"description": "Logic to determine whether the account should be added as a subAccount for customer\nThis should be true if the main accountId can be used for ordering or getting pricing"
121+
},
122+
"accounts": {
123+
"type": "array",
124+
"description": "List of subAccounts associated with the customer's vendor account\nSubAccounts can be used for ordering or getting pricing",
125+
"items": {
126+
"$ref": "#/definitions/VendorSubAccountDto"
127+
}
128+
},
129+
"vendorIdentifiers": {
130+
"type": [
131+
"null",
132+
"object"
133+
],
134+
"description": "A collection of identifiers specific to the Vendor, which will be passed back to the vendor on all subsequent calls for this account",
135+
"additionalProperties": {
136+
"type": "string"
137+
}
138+
}
139+
}
140+
},
141+
"VendorSubAccountDto": {
142+
"type": "object",
143+
"description": "Model representing a customer's vendor subAccount associated with their vendor account",
144+
"additionalProperties": false,
145+
"properties": {
146+
"subAccountId": {
147+
"type": "string",
148+
"description": "Customer's vendor subAccount Id"
149+
},
150+
"name": {
151+
"type": "string",
152+
"description": "Name associated with the subAccount"
153+
},
154+
"postalCode": {
155+
"type": [
156+
"null",
157+
"string"
158+
],
159+
"description": "Postal Code associated with the subAccount"
160+
},
161+
"customFields": {
162+
"type": "object",
163+
"description": "Any custom fields to display to user for this subAccount",
164+
"additionalProperties": {
165+
"type": "string"
166+
}
167+
}
168+
}
169+
}
170+
}
171+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"errorCode": "errorCode",
3+
"callBackInfo": null,
4+
"success": false,
5+
"errorKind": "errorKind",
6+
"message": "message",
7+
"errorMessage": "errorMessage",
8+
"account": null,
9+
"accounts": [
10+
{
11+
"subAccountId": "subAccountId",
12+
"name": "name",
13+
"postalCode": "postalCode",
14+
"customFields": {}
15+
}
16+
],
17+
"hasMorePages": false,
18+
"$schema": "./account.response.schema.json"
19+
}

st-schemas/accounts/request.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"title": "accounts.request",
4+
"type": "object",
5+
"description": "Request used to retrieve all accounts that a tenant's SSO login has access to from the supplier.\nOnly used for single sign-on (SSO) suppliers.",
6+
"additionalProperties": false,
7+
"properties": {
8+
"vendorId": {
9+
"type": "string"
10+
},
11+
"callbackData": {
12+
"type": [
13+
"null",
14+
"object"
15+
],
16+
"description": "Generic data that is specified by the previous request's CallbackInfo",
17+
"additionalProperties": {}
18+
}
19+
}
20+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"vendorId": "vendorId",
3+
"callbackData": {}
4+
}

0 commit comments

Comments
 (0)