Skip to content

Commit ac622cc

Browse files
committed
Update fees and rentals_fees endpoints with new actions and attributes
1 parent 36e129a commit ac622cc

File tree

9 files changed

+171
-6
lines changed

9 files changed

+171
-6
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"fees": [
3+
{
4+
"name":{
5+
"en":"Fee"
6+
},
7+
"kind": "other",
8+
"rate": "12.0",
9+
"rate_kind": "fixed",
10+
"downpayment_percentage": "0.0"
11+
}
12+
]
13+
}

api_calls/reference/fees/public-scope-response.json renamed to api_calls/reference/fees/public-rates_write-scope-response.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
},
1515
"rate": "12.0",
1616
"rate_kind": "fixed",
17+
"archived_at": null,
1718
"created_at": "2015-03-18T09:33:45Z",
1819
"updated_at": "2015-03-18T09:33:45Z",
1920
"downpayment_percentage": "0.0"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"fees": [
3+
{
4+
"name":{
5+
"en":"Fee"
6+
},
7+
"kind": "other",
8+
"rate": "12.0",
9+
"rate_kind": "fixed",
10+
"downpayment_percentage": "0.0"
11+
}
12+
]
13+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"rentals_fees": [
3+
{
4+
"fee_id": 9,
5+
"always_applied": true,
6+
"maximum_bookable": 12
7+
}
8+
]
9+
}

api_calls/reference/rentals_fees/public-scope-response.json renamed to api_calls/reference/rentals_fees/public-rentals_write-scope-response.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
{
22
"links": {
33
"rentals_fees.fee": "http://www.bookingsync.com/api/v3/fees/{rentals_fees.fee}",
4-
"rentals_fees.rental": "http://www.bookingsync.com/api/v3/rentals/{rentals_fees.rental}"
4+
"rentals_fees.rental": "http://www.bookingsync.com/api/v3/rentals/{rentals_fees.rental}",
5+
"rentals_fees.seasons": "http://www.bookingsync.com/api/v3/seasons/{rentals_fees.seasons}"
56
},
67
"rentals_fees": [
78
{
89
"links": {
910
"fee": 9,
10-
"rental": 1
11+
"rental": 1,
12+
"seasons": []
1113
},
1214
"id": 6,
1315
"always_applied": true,
1416
"end_date": null,
1517
"maximum_bookable": 12,
18+
"name": {
19+
"en": "NAME"
20+
},
1621
"public": false,
22+
"rate": 10,
23+
"rate_kind": "fixed",
1724
"required": false,
1825
"start_date": null,
26+
"archived_at": null,
1927
"created_at": "2015-03-18T09:34:01Z",
2028
"updated_at": "2015-03-18T09:34:01Z"
2129
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"rentals_fees": [
3+
{
4+
"always_applied": "true",
5+
"maximum_bookable": 12
6+
}
7+
]
8+
}

content/reference/changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2017-02-09
4+
5+
* [doc update] Update `fees` and `rentals_fees` endpoints with new actions and attributes.
6+
37
## 2017-02-07
48

59
* [doc fix] Rentals' `price_public_notes` should be written from RatesTables.

content/reference/endpoints/fees.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ul class="nav nav-pills" role="tablist">
88
<li class="disabled"><a>OAuth Scopes:</a></li>
99
<li class="active"><a href="#public" role="tab" data-toggle="pill">public</a></li>
10+
<li><a href="#rates_write" role="tab" data-toggle="pill">rates_write</a></li>
1011
</ul>
1112
<div class="tab-content" markdown="1">
1213
<div class="tab-pane active" id="public" markdown="1">
@@ -20,6 +21,23 @@ kind | String | Read | Fee's kind, list of fee's kinds descri
2021
rate | [Decimal](/reference/enums#formats) | Read | Fee's rate.
2122
rate_kind | String | Read | Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
2223
-----------------|---------|------------|------------
24+
archived_at | [Time](/reference/enums#formats) | Read | Fee's archive time.
25+
created_at | [Time](/reference/enums#formats) | Read | Fee's create time.
26+
updated_at | [Time](/reference/enums#formats) | Read | Fee's update time.
27+
{: class="table table-bordered"}
28+
</div>
29+
<div class="tab-pane" id="rates_write" markdown="1">
30+
Name | Type | Read/Write | Description
31+
-----------------|---------|------------|------------
32+
id | Integer | Read | Fee's id.
33+
-----------------|---------|------------|------------
34+
downpayment_percentage | [Decimal](/reference/enums#formats) | Read/Write | Fee's downpayment percentage.
35+
name | [Object](/reference/enums#formats) | Read/Write | Fee's name, list of locales described in [enums section](/reference/enums#locales).
36+
kind | String | Read/Write | Fee's kind, list of fee's kinds described in [enums section](/reference/enums#fee-kinds)
37+
rate | [Decimal](/reference/enums#formats) | Read/Write | Fee's rate.
38+
rate_kind | String | Read/Write | Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
39+
-----------------|---------|------------|------------
40+
archived_at | [Time](/reference/enums#formats) | Read | Fee's archive time.
2341
created_at | [Time](/reference/enums#formats) | Read | Fee's create time.
2442
updated_at | [Time](/reference/enums#formats) | Read | Fee's update time.
2543
{: class="table table-bordered"}
@@ -34,7 +52,7 @@ List all fees for given account(s).
3452
GET /fees
3553
~~~
3654

37-
<%= render 'json_response', endpoint: "fees", scopes: %w(public) %>
55+
<%= render 'json_response', endpoint: "fees", scopes: [{ public: "public-rates_write" }] %>
3856

3957
## Get a single fee
4058

@@ -44,4 +62,36 @@ Returns a single fee identified by ID.
4462
GET /fees/:fee_id
4563
~~~
4664

47-
<%= render 'json_response', endpoint: "fees", scopes: %w(public) %>
65+
<%= render 'json_response', endpoint: "fees", scopes: [{ public: "public-rates_write" }] %>
66+
67+
## Create a new fee
68+
69+
Returns a newly created fee.
70+
71+
~~~
72+
POST /fees
73+
~~~
74+
75+
<%= render 'json_response', endpoint: "fees", request: "create",
76+
scopes: [{ rates_write: "public-rates_write" }] %>
77+
78+
## Update a fee
79+
80+
Returns an updated fee identified by ID.
81+
82+
~~~
83+
PUT /fees/:fee_id
84+
~~~
85+
86+
<%= render 'json_response', endpoint: "fees", request: "update",
87+
scopes: [{ rates_write: "public-rates_write" }] %>
88+
89+
## Destroy a fee
90+
91+
Required OAuth scope: `:rates_write`
92+
93+
Returns empty response with '204 No Content' status code on success.
94+
95+
~~~~~~
96+
DELETE /fees/:fee_id
97+
~~~~~~

content/reference/endpoints/rentals_fees.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ul class="nav nav-pills" role="tablist">
88
<li class="disabled"><a>OAuth Scopes:</a></li>
99
<li class="active"><a href="#public" role="tab" data-toggle="pill">public</a></li>
10+
<li><a href="#rentals_write" role="tab" data-toggle="pill">rentals_write</a></li>
1011
</ul>
1112
<div class="tab-content" markdown="1">
1213
<div class="tab-pane active" id="public" markdown="1">
@@ -16,13 +17,39 @@ id | Integer | Read | Rentals Fee's id.
1617
-----------------|---------|------------|------------
1718
always_applied | Boolean | Read | Available to all seasons and periods if set to true.
1819
maximum_bookable | Integer | Read | Rentals Fee's maximum booked count.
20+
name | [Object](/reference/enums#formats) | Read | Rentals Fee's name, list of locales described in [enums section](/reference/enums#locales).
1921
public | Boolean | Read | Publicly bookable by client if set to true.
22+
rate | [Decimal](/reference/enums#formats) | Read | Rentals Fee's rate.
23+
rate_kind | String | Read | Rentals Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
2024
required | Boolean | Read | Always included for new bookings, also public if set to true.
2125
-----------------|---------|------------|------------
26+
archived_at | [Time](/reference/enums#formats) | Read | Rentals Fee's archive time.
2227
created_at | [Time](/reference/enums#formats) | Read | Rentals Fee's create time.
2328
updated_at | [Time](/reference/enums#formats) | Read | Rentals Fee's update time.
2429
start_date | [Date](/reference/enums#formats) | Read | Rentals Fee's start date.
2530
end_date | [Date](/reference/enums#formats) | Read | Rentals Fee's end date.
31+
{: class="table table-bordered"}
32+
</div>
33+
<div class="tab-pane" id="rentals_write" markdown="1">
34+
Name | Type | Read/Write | Description
35+
-----------------|---------|------------|------------
36+
id | Integer | Read | Rentals Fee's id.
37+
fee_id | Integer | Write | Fee id related to the Rentals Fee.
38+
season_ids | Array | Write | Season ids related to the Rentals Fee.
39+
-----------------|---------|------------|------------
40+
always_applied | Boolean | Read/Write | Available to all seasons and periods if set to true.
41+
maximum_bookable | Integer | Read/Write | Rentals Fee's maximum booked count.
42+
name | [Object](/reference/enums#formats) | Read | Rentals Fee's name, list of locales described in [enums section](/reference/enums#locales).
43+
public | Boolean | Read | Publicly bookable by client if set to true.
44+
rate | [Decimal](/reference/enums#formats) | Read | Rentals Fee's rate.
45+
rate_kind | String | Read | Rentals Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds).
46+
required | Boolean | Read | Always included for new bookings, also public if set to true.
47+
-----------------|---------|------------|------------
48+
archived_at | [Time](/reference/enums#formats) | Read | Rentals Fee's archive time.
49+
created_at | [Time](/reference/enums#formats) | Read | Rentals Fee's create time.
50+
updated_at | [Time](/reference/enums#formats) | Read | Rentals Fee's update time.
51+
start_date | [Date](/reference/enums#formats) | Read/Write | Rentals Fee's start date.
52+
end_date | [Date](/reference/enums#formats) | Read/Write | Rentals Fee's end date.
2653
{: class="table table-bordered"}
2754
</div>
2855
</div>
@@ -35,7 +62,7 @@ List all rentals fees for given account(s).
3562
GET /rentals_fees
3663
~~~
3764

38-
<%= render 'json_response', endpoint: "rentals_fees", scopes: %w(public) %>
65+
<%= render 'json_response', endpoint: "rentals_fees", scopes: [{ public: "public-rentals_write" }] %>
3966

4067
## Get a single rentals fee
4168

@@ -45,4 +72,36 @@ Returns a single rentals fee identified by ID.
4572
GET /rentals_fees/:rentals_fee_id
4673
~~~
4774

48-
<%= render 'json_response', endpoint: "rentals_fees", scopes: %w(public) %>
75+
<%= render 'json_response', endpoint: "rentals_fees", scopes: [{ public: "public-rentals_write" }] %>
76+
77+
## Create a new rentals fee
78+
79+
Creates a rentals fee for given rental.
80+
81+
~~~
82+
POST /rentals/:rental_id/rentals_fee
83+
~~~
84+
85+
<%= render 'json_response', endpoint: "rentals_fees", request: "create",
86+
scopes: [{ rentals_write: "public-rentals_write" }] %>
87+
88+
## Update a rentals fee
89+
90+
Returns an updated rentals fee identified by ID.
91+
92+
~~~
93+
PUT /rentals_fee/:special_offer
94+
~~~
95+
96+
<%= render 'json_response', endpoint: "rentals_fees", request: "update",
97+
scopes: [{ rentals_write: "public-rentals_write" }] %>
98+
99+
## Destroy a rentals fee
100+
101+
Required OAuth scope: `:rentals_write`
102+
103+
Returns empty response with '204 No Content' status code on success.
104+
105+
~~~~~~
106+
DELETE /rentals_fee/:special_offer_id
107+
~~~~~~

0 commit comments

Comments
 (0)