forked from XeroAPI/Xero-OpenAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xero-app-store.yaml
257 lines (257 loc) · 8.42 KB
/
xero-app-store.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
openapi: 3.0.0
info:
version: "2.15.0"
title: Xero AppStore API
description: These endpoints are for Xero Partners to interact with the App Store Billing platform
termsOfService: "https://developer.xero.com/xero-developer-platform-terms-conditions/"
contact:
name: "Xero Platform Team"
email: "[email protected]"
url: "https://developer.xero.com"
license:
name: MIT
url: "https://github.com/XeroAPI/Xero-OpenAPI/blob/master/LICENSE"
servers:
- description: Xero App Store API
url: "https://api.xero.com/appstore/2.0"
paths:
"/subscriptions/{subscriptionId}":
get:
tags:
- AppStore
operationId: getSubscription
summary: Retrieves a subscription for a given subscriptionId
parameters:
- $ref: "#/components/parameters/subscriptionId"
responses:
"200":
description: Success - return response of unique Subscription object
content:
application/json:
schema:
$ref: "#/components/schemas/Subscription"
example: '
{
"currentPeriodEnd": "2021-07-20T03:13:48Z",
"endDate": "2021-07-20T03:13:48Z",
"id": "01b5a6f4-8936-4bfa-b703-830702312b87",
"testMode": true,
"organisationId": "fdc5be44-9b3e-4ebb-a0e9-11b9737f9a28",
"plans": [
{
"id": "f617dd59-462f-46a1-9519-1765fd38b160",
"name": "Small",
"status": "ACTIVE",
"subscriptionItems": [
{
"endDate": "2021-07-20T03:13:48Z",
"id": "c7336bf6-8a47-4f13-9fc0-82420e6922c8",
"price": {
"amount": 50,
"currency": "AUD",
"id": "31acefbe-bdb7-4329-84d6-51e9afd95327"
},
"product": {
"id": "56d66073-ff78-497b-a726-ca9d56fdafa3",
"name": "Small",
"type": "FIXED"
},
"startDate": "2021-07-20T03:13:48Z"
}
]
}
],
"startDate": "2021-07-20T03:13:48Z",
"status": "ACTIVE"
}
'
"404":
content:
application/json:
schema:
$ref: "#/components/schemas/ProblemDetails"
description: "When a failure occurs in the endpoint"
security:
- OAuth2: [marketplace.billing]
components:
securitySchemes:
OAuth2:
type: oauth2
description: For more information
flows:
clientCredentials:
tokenUrl: "https://identity.xero.com/connect/token"
scopes:
marketplace.billing: Grant read-only access to fixed assets
parameters:
subscriptionId:
required: true
in: path
name: subscriptionId
x-snake: subscription_id
description: Unique identifier for Subscription object
example: "00000000-0000-0000-0000-000000000000"
x-example-java: UUID.fromString("00000000-0000-0000-0000-000000000000")
x-example-php: '"00000000-0000-0000-0000-000000000000"'
x-example-csharp: Guid.Parse("00000000-0000-0000-0000-000000000000");
schema:
type: string
format: uuid
schemas:
Subscription:
type: object
properties:
currentPeriodEnd:
description: |
End of the current period that the subscription has been invoiced for.
format: date-time
type: string
endDate:
description: If the subscription has been canceled, this is the date when the subscription ends. If null, the subscription is active and has not been cancelled
format: date-time
type: string
id:
description: The unique identifier of the subscription
format: uuid
type: string
organisationId:
description: The Xero generated unique identifier for the organisation
format: uuid
type: string
plans:
description: List of plans for the subscription.
type: array
items:
$ref: "#/components/schemas/Plan"
startDate:
description: Date when the subscription was first created.
format: date-time
type: string
status:
description: Status of the subscription. Available statuses are ACTIVE, CANCELED, and PAST_DUE.
type: string
testMode:
description: Boolean used to indicate if the subscription is in test mode
type: boolean
required:
- id
- organisationId
- status
- startDate
- currentPeriodEnd
- plans
Plan:
type: object
properties:
id:
description: The unique identifier of the plan
format: uuid
type: string
name:
description: |
The name of the plan. It is used in the invoice line item
description.
type: string
status:
description: |
Status of the plan. Available statuses are ACTIVE,
PENDING_ACTIVATION.
type: string
enum:
- ACTIVE
- PENDING_ACTIVATION
subscriptionItems:
description: |
List of the subscription items belonging to the plan. It does not
include cancelled subscription items.
items:
$ref: "#/components/schemas/SubscriptionItem"
type: array
required:
- id
- name
- status
- subscriptionItems
Price:
type: object
properties:
amount:
description: The net (before tax) amount.
type: number
format: double
x-is-money: true
currency:
description: The currency of the price.
type: string
id:
description: The unique identifier of the price.
format: uuid
type: string
required:
- id
- amount
- currency
ProblemDetails:
type: object
properties:
detail:
type: string
extensions:
type: object
instance:
type: string
status:
type: integer
title:
type: string
type:
type: string
SubscriptionItem:
type: object
properties:
endDate:
description: Date when the subscription to this product will end
format: date-time
type: string
id:
description: The unique identifier of the subscription item.
format: uuid
type: string
price:
description: The price of the product subscribed to.
$ref: "#/components/schemas/Price"
product:
description: The product subscribed to.
$ref: "#/components/schemas/Product"
startDate:
description: |
Date the subscription started, or will start. Note: this could be in
the future for downgrades or reduced number of seats that haven't taken effect yet.
format: date-time
type: string
testMode:
description: If the subscription is a test subscription
type: boolean
required:
- id
- startDate
- product
- price
Product:
properties:
id:
description: The unique identifier for the product
type: string
format: uuid
name:
description: The name of the product
type: string
type:
description: |
The pricing model of the product:
* FIXED: Customers are charged a fixed amount for each billing period
* PER_SEAT: Customers are charged based on the number of units they purchase
type: string
enum:
- FIXED
- PER_SEAT