Skip to content

Commit 856c6b0

Browse files
author
blalonde
authored
Merge pull request #38 from sherweb/openapiupdate
Format Open API spec
2 parents b993d06 + 3780501 commit 856c6b0

File tree

1 file changed

+168
-125
lines changed

1 file changed

+168
-125
lines changed

Sherweb.Apis.Distributor.OpenAPI.json

Lines changed: 168 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"paths": {
88
"/billing/payable-charges": {
99
"get": {
10-
"tags": [ "PayableCharges" ],
10+
"tags": [
11+
"PayableCharges"
12+
],
1113
"summary": "GetPayableCharges",
1214
"description": "Get your payable charges data for a specific billing period. There are three types of charges that are included in\r\nthe data returned: recurring, usage, and setup.",
1315
"operationId": "GetPayableCharges",
@@ -25,135 +27,34 @@
2527
"name": "Accept-Language",
2628
"in": "header",
2729
"description": "Specify language (and culture) following [RFC 7231, section 5.3.5: Accept-Language].",
28-
"schema": { "type": "string" }
30+
"schema": {
31+
"type": "string"
32+
}
2933
}
3034
],
3135
"responses": {
3236
"200": {
3337
"description": "Success",
34-
"content": { "application/json": { "schema": { "$ref": "#/components/schemas/PayableCharges" } } }
38+
"content": {
39+
"application/json": {
40+
"schema": {
41+
"$ref": "#/components/schemas/PayableCharges"
42+
}
43+
}
44+
}
3545
}
3646
}
3747
}
3848
}
3949
},
4050
"components": {
4151
"schemas": {
42-
"ChargeType": {
43-
"enum": [ "Setup", "Recurring", "Usage", "Unknown" ],
44-
"type": "string",
45-
"description": "Setup (occurs only once and can be used for activation, cancellation or setup fees),\r\nRecurring (invoiced on a monthly or yearly basis),\r\nUsage (varies based on the quantity of the product or service consumed by the customer),\r\nUnknown (charge type not found. This may happen when querying data from older invoices)."
46-
},
47-
"DeductionType": {
48-
"enum": [ "PromotionalMoney", "PromotionalPercentage", "PerformancePercentage" ],
49-
"type": "string",
50-
"description": "PromotionalMoney (fixed price promotional discount),\r\nPromotionalPercentage (promotional percentage discount),\r\nPerformancePercentage (deduction linked to performance tier)."
51-
},
52-
"Deduction": {
53-
"type": "object",
54-
"properties": {
55-
"code": {
56-
"type": "string",
57-
"nullable": true
58-
},
59-
"name": {
60-
"type": "string",
61-
"nullable": true
62-
},
63-
"deductionType": { "$ref": "#/components/schemas/DeductionType" },
64-
"value": {
65-
"type": "number",
66-
"format": "double"
67-
},
68-
"unitValue": {
69-
"type": "number",
70-
"description": "Deduction value prorated per unit.",
71-
"format": "double"
72-
},
73-
"totalValue": {
74-
"type": "number",
75-
"description": "Deduction value for line (unitValue * quantity).",
76-
"format": "double"
77-
}
78-
},
79-
"additionalProperties": false,
80-
"description": "Deduction applied to a charge."
81-
},
82-
"Fee": {
83-
"type": "object",
84-
"properties": {
85-
"name": {
86-
"type": "string",
87-
"nullable": true
88-
},
89-
"unitValue": {
90-
"type": "number",
91-
"format": "double"
92-
},
93-
"totalValue": {
94-
"type": "number",
95-
"format": "double"
96-
},
97-
"isTaxable": { "type": "boolean" }
98-
},
99-
"additionalProperties": false,
100-
"description": "Fee associated with a charge."
101-
},
102-
"Invoice": {
103-
"type": "object",
104-
"properties": {
105-
"number": {
106-
"type": "string",
107-
"nullable": true
108-
},
109-
"date": {
110-
"type": "string",
111-
"format": "date"
112-
},
113-
"periodFrom": {
114-
"type": "string",
115-
"format": "date"
116-
},
117-
"periodTo": {
118-
"type": "string",
119-
"format": "date"
120-
}
121-
},
122-
"additionalProperties": false,
123-
"description": "Information on the invoice where the charge was applied."
124-
},
125-
"Tax": {
126-
"type": "object",
127-
"properties": {
128-
"name": {
129-
"type": "string",
130-
"nullable": true
131-
},
132-
"appliedRate": {
133-
"type": "number",
134-
"format": "double"
135-
}
136-
},
137-
"additionalProperties": false,
138-
"description": "Tax rate applied to a charge."
139-
},
140-
"Tag": {
141-
"type": "object",
142-
"properties": {
143-
"name": {
144-
"type": "string",
145-
"nullable": true
146-
},
147-
"value": {
148-
"type": "string",
149-
"nullable": true
150-
}
151-
},
152-
"additionalProperties": false,
153-
"description": "Additional information about the charge, including customer information."
154-
},
15552
"BillingCycleType": {
156-
"enum": [ "OneTime", "Monthly", "Yearly" ],
53+
"enum": [
54+
"OneTime",
55+
"Monthly",
56+
"Yearly"
57+
],
15758
"type": "string",
15859
"description": "OneTime (charged once, with no recurrence),\r\nMonthly (charged monthly),\r\nYearly (charged yearly)."
15960
},
@@ -182,8 +83,12 @@
18283
"type": "string",
18384
"nullable": true
18485
},
185-
"chargeType": { "$ref": "#/components/schemas/ChargeType" },
186-
"billingCycleType": { "$ref": "#/components/schemas/BillingCycleType" },
86+
"chargeType": {
87+
"$ref": "#/components/schemas/ChargeType"
88+
},
89+
"billingCycleType": {
90+
"$ref": "#/components/schemas/BillingCycleType"
91+
},
18792
"periodFrom": {
18893
"type": "string",
18994
"format": "date"
@@ -229,29 +134,135 @@
229134
},
230135
"deductions": {
231136
"type": "array",
232-
"items": { "$ref": "#/components/schemas/Deduction" },
137+
"items": {
138+
"$ref": "#/components/schemas/Deduction"
139+
},
233140
"nullable": true
234141
},
235142
"fees": {
236143
"type": "array",
237-
"items": { "$ref": "#/components/schemas/Fee" },
144+
"items": {
145+
"$ref": "#/components/schemas/Fee"
146+
},
238147
"nullable": true
239148
},
240-
"invoice": { "$ref": "#/components/schemas/Invoice" },
149+
"invoice": {
150+
"$ref": "#/components/schemas/Invoice"
151+
},
241152
"taxes": {
242153
"type": "array",
243-
"items": { "$ref": "#/components/schemas/Tax" },
154+
"items": {
155+
"$ref": "#/components/schemas/Tax"
156+
},
244157
"nullable": true
245158
},
246159
"tags": {
247160
"type": "array",
248-
"items": { "$ref": "#/components/schemas/Tag" },
161+
"items": {
162+
"$ref": "#/components/schemas/Tag"
163+
},
249164
"nullable": true
250165
}
251166
},
252167
"additionalProperties": false,
253168
"description": "A product is constituted of one or multiple charges."
254169
},
170+
"ChargeType": {
171+
"enum": [
172+
"Setup",
173+
"Recurring",
174+
"Usage",
175+
"Unknown"
176+
],
177+
"type": "string",
178+
"description": "Setup (occurs only once and can be used for activation, cancellation or setup fees),\r\nRecurring (invoiced on a monthly or yearly basis),\r\nUsage (varies based on the quantity of the product or service consumed by the customer),\r\nUnknown (charge type not found. This may happen when querying data from older invoices)."
179+
},
180+
"Deduction": {
181+
"type": "object",
182+
"properties": {
183+
"code": {
184+
"type": "string",
185+
"nullable": true
186+
},
187+
"name": {
188+
"type": "string",
189+
"nullable": true
190+
},
191+
"deductionType": {
192+
"$ref": "#/components/schemas/DeductionType"
193+
},
194+
"value": {
195+
"type": "number",
196+
"format": "double"
197+
},
198+
"unitValue": {
199+
"type": "number",
200+
"description": "Deduction value prorated per unit.",
201+
"format": "double"
202+
},
203+
"totalValue": {
204+
"type": "number",
205+
"description": "Deduction value for line (unitValue * quantity).",
206+
"format": "double"
207+
}
208+
},
209+
"additionalProperties": false,
210+
"description": "Deduction applied to a charge."
211+
},
212+
"DeductionType": {
213+
"enum": [
214+
"PromotionalMoney",
215+
"PromotionalPercentage",
216+
"PerformancePercentage"
217+
],
218+
"type": "string",
219+
"description": "PromotionalMoney (fixed price promotional discount),\r\nPromotionalPercentage (promotional percentage discount),\r\nPerformancePercentage (deduction linked to performance tier)."
220+
},
221+
"Fee": {
222+
"type": "object",
223+
"properties": {
224+
"name": {
225+
"type": "string",
226+
"nullable": true
227+
},
228+
"unitValue": {
229+
"type": "number",
230+
"format": "double"
231+
},
232+
"totalValue": {
233+
"type": "number",
234+
"format": "double"
235+
},
236+
"isTaxable": {
237+
"type": "boolean"
238+
}
239+
},
240+
"additionalProperties": false,
241+
"description": "Fee associated with a charge."
242+
},
243+
"Invoice": {
244+
"type": "object",
245+
"properties": {
246+
"number": {
247+
"type": "string",
248+
"nullable": true
249+
},
250+
"date": {
251+
"type": "string",
252+
"format": "date"
253+
},
254+
"periodFrom": {
255+
"type": "string",
256+
"format": "date"
257+
},
258+
"periodTo": {
259+
"type": "string",
260+
"format": "date"
261+
}
262+
},
263+
"additionalProperties": false,
264+
"description": "Information on the invoice where the charge was applied."
265+
},
255266
"PayableCharges": {
256267
"type": "object",
257268
"properties": {
@@ -265,12 +276,44 @@
265276
},
266277
"charges": {
267278
"type": "array",
268-
"items": { "$ref": "#/components/schemas/Charge" },
279+
"items": {
280+
"$ref": "#/components/schemas/Charge"
281+
},
269282
"nullable": true
270283
}
271284
},
272285
"additionalProperties": false,
273286
"description": "All charges to pay for a billing period."
287+
},
288+
"Tag": {
289+
"type": "object",
290+
"properties": {
291+
"name": {
292+
"type": "string",
293+
"nullable": true
294+
},
295+
"value": {
296+
"type": "string",
297+
"nullable": true
298+
}
299+
},
300+
"additionalProperties": false,
301+
"description": "Additional information about the charge, including customer information."
302+
},
303+
"Tax": {
304+
"type": "object",
305+
"properties": {
306+
"name": {
307+
"type": "string",
308+
"nullable": true
309+
},
310+
"appliedRate": {
311+
"type": "number",
312+
"format": "double"
313+
}
314+
},
315+
"additionalProperties": false,
316+
"description": "Tax rate applied to a charge."
274317
}
275318
}
276319
}

0 commit comments

Comments
 (0)