|
1 | 1 | # Payments
|
2 | 2 |
|
3 |
| -## `invoices.list({limit, lastId})` |
4 |
| -List all avaiable invoices for a given `limit`, `lastId` |
5 |
| - |
6 |
| -#### Params |
7 |
| - |
8 |
| -| Name | Type | Required | Description | |
9 |
| -| ------- | ------ | -------- | ------------------------- | |
10 |
| -| limit | int | No | Limit results per request | |
11 |
| -| lastId | string | No | Used for Pagination | |
12 |
| - |
13 |
| -```js |
14 |
| -const data = await deskbookers.payments.invoices.list({}) |
15 |
| -``` |
16 |
| - |
17 |
| -## `invoices.get({invoiceId})` |
18 |
| -List all avaiable invoices for a given `invoiceId` |
19 |
| - |
20 |
| -#### Params |
21 |
| - |
22 |
| -| Name | Type | Required | Description | |
23 |
| -| --------- | ------ | -------- | ----------------------- | |
24 |
| -| invoiceId | int | Yes | Invoice Id | |
25 |
| - |
26 |
| -```js |
27 |
| -const data = await deskbookers.payments.invoices.get( |
28 |
| - {invoiceId: 'in_1AmlLiGAwNnYLy52pW4WN9p1'} |
29 |
| -) |
30 |
| -``` |
31 |
| - |
32 |
| -## `plans.list({limit, lastId})` |
33 |
| -List all avaiable plans for a given `limit`, `lastId` |
34 |
| - |
35 |
| -#### Params |
36 |
| - |
37 |
| -| Name | Type | Required | Description | |
38 |
| -| ------- | ------ | -------- | ------------------------- | |
39 |
| -| limit | int | No | Limit results per request | |
40 |
| -| lastId | string | No | Used for Pagination | |
41 |
| - |
42 |
| -```js |
43 |
| -const data = await deskbookers.payments.plans.list({}) |
44 |
| -``` |
45 |
| - |
46 |
| -## `plans.get({planId})` |
47 |
| -List all avaiable plans for a given `planId` |
48 |
| - |
49 |
| -#### Params |
50 |
| - |
51 |
| -| Name | Type | Required | Description | |
52 |
| -| --------- | ------ | -------- | ----------------------- | |
53 |
| -| planId | int | Yes | Plan Id | |
54 |
| - |
55 |
| -```js |
56 |
| -const data = await deskbookers.payments.plans.get( |
57 |
| - {planId: 'bookingTool-9900-1x-month-0'} |
58 |
| -) |
59 |
| -``` |
60 |
| - |
61 |
| -## `plans.subscriptions({planId})` |
62 |
| -List all avaiable subscriptions for a given `planId` |
63 |
| - |
64 |
| -#### Params |
65 |
| - |
66 |
| -| Name | Type | Required | Description | |
67 |
| -| --------- | ------ | -------- | ----------------------- | |
68 |
| -| planId | int | Yes | Plan Id | |
69 |
| - |
70 |
| -```js |
71 |
| -const data = await deskbookers.payments.plans.get( |
72 |
| - {planId: 'bookingTool-9900-1x-month-0'} |
73 |
| -) |
74 |
| -``` |
75 |
| - |
76 |
| -## `subscriptions.list({limit, lastId, status})` |
77 |
| -List all avaiable subscriptions for a given `limit`, `lastId` and `status` |
78 |
| - |
79 |
| -#### Params |
80 |
| - |
81 |
| -| Name | Type | Required | Description | |
82 |
| -| ------- | ------ | -------- | ------------------------- | |
83 |
| -| limit | int | No | Limit results per request | |
84 |
| -| lastId | string | No | Used for Pagination | |
85 |
| -| status | string | No | Used for filtering | |
86 |
| - |
87 |
| -```js |
88 |
| -const data = await deskbookers.payments.subscriptions.list( |
89 |
| - {limit: 1, status: 'active'} |
90 |
| -) |
91 |
| -``` |
92 |
| - |
93 |
| -## `subscriptions.get({subscriptionId})` |
94 |
| -Get subscription for a given `subscriptionId` |
95 |
| - |
96 |
| -#### Params |
97 |
| - |
98 |
| -| Name | Type | Required | Description | |
99 |
| -| -------------- | ------ | -------- | ------------------- | |
100 |
| -| subscriptionId | int | Yes | Subscription Id | |
101 |
| - |
102 |
| -```js |
103 |
| -const data = await deskbookers.payments.subscriptions.get( |
104 |
| - {subscriptionId: 'sub_B93SRrYAV6KF7V'} |
105 |
| -) |
106 |
| -``` |
107 | 3 |
|
108 | 4 | ## `users.get({userId})`
|
109 | 5 | Get user for a given `userId`
|
@@ -211,68 +107,6 @@ const data = await deskbookers.payments.users.createSource({
|
211 | 107 | })
|
212 | 108 | ```
|
213 | 109 |
|
214 |
| -## `users.createSubscription({userId, subscription})` |
215 |
| -Create subscriptions for a given `userId` |
216 |
| - |
217 |
| -#### Params |
218 |
| - |
219 |
| -| Name | Type | Required | Description | |
220 |
| -| -------------- | ------ | -------- | ------------------- | |
221 |
| -| userId | string | Yes | User Id | |
222 |
| -| subscription | object | Yes | Subscription Object | |
223 |
| - |
224 |
| -#### Subscription |
225 |
| - |
226 |
| -| Name | Type | Required | Description | |
227 |
| -| ------------- | ------ | -------- | --------------------- | |
228 |
| -| currency | string | Yes | Subscription currency | |
229 |
| -| userUid | string | Yes | Origin of 'features' | |
230 |
| -| interval | object | Yes | Subscription interval | |
231 |
| -| email | string | Yes | Subscription email | |
232 |
| -| vat | int | Yes | Subscription vat | |
233 |
| -| plans | object | Yes | Subscription Plans | |
234 |
| - |
235 |
| -#### Interval |
236 |
| - |
237 |
| -| Name | Type | Required | Description | |
238 |
| -| ----------- | ------ | -------- | ----------------------- | |
239 |
| -| period | string | Yes | Interval period | |
240 |
| -| count | int | Yes | Interval count | |
241 |
| - |
242 |
| -#### plans |
243 |
| - |
244 |
| -| Name | Type | Required | Description | |
245 |
| -| ----------- | ------ | -------- | ----------------------- | |
246 |
| -| feature | string | Yes | Plans feature | |
247 |
| -| name | string | Yes | Plans name | |
248 |
| -| amount | float | Yes | Plans amount | |
249 |
| - |
250 |
| - |
251 |
| -```js |
252 |
| -const data = await deskbookers.payments.users.createSubscription({ |
253 |
| - userId: 'rb6', |
254 |
| - subscription: { |
255 |
| - currency: 'eur', |
256 |
| - userUid: 'features', |
257 |
| - interval: { period: 'month', count: 1 }, |
258 |
| - |
259 |
| - vat: 21, |
260 |
| - plans: [ |
261 |
| - { |
262 |
| - feature: 'basic', |
263 |
| - name: 'Deskbookers for Partners Basic', |
264 |
| - amount: 10.0 |
265 |
| - }, |
266 |
| - { |
267 |
| - feature: 'bookingTool', |
268 |
| - name: 'Booking tool', |
269 |
| - amount: 99.0 |
270 |
| - } |
271 |
| - ] |
272 |
| - } |
273 |
| -}) |
274 |
| -``` |
275 |
| - |
276 | 110 | ## `users.createCharge({userId, charge})`
|
277 | 111 | Create a charge for a given `userId` and `charge`
|
278 | 112 |
|
|
0 commit comments